package
1.79.0-mod
Repository: https://github.com/sagernet/tailscale.git
Documentation: pkg.go.dev

# Functions

PolicyFor returns the [Policy] for the specified scope, creating it from the registered [source.Store]s if it doesn't already exist.
RegisterStore registers a new policy [source.Store] with the specified name and [setting.PolicyScope].
RegisterStoreForTest is like [RegisterStore], but unregisters the store when tb and all its subtests complete.

# Variables

ErrAlreadyConsumed is the error returned when [StoreRegistration.ReplaceStore] or [StoreRegistration.Unregister] is called more than once.
ErrPolicyClosed is returned by [Policy.Reload], [Policy.addSource], [Policy.removeSource] and [Policy.replaceSource] if the policy has been closed.

# Structs

Change represents a change from the Old to the New value of type T.
Policy provides access to the current effective [setting.Snapshot] for a given scope and allows to reload it from the underlying [source.Store] list.
PolicyChange describes a policy change.
StoreRegistration is a [source.Store] registered for use in the specified scope.

# Type aliases

PolicyChangeCallback is a function called whenever a policy changes.