# Functions
DefaultScope returns the default [PolicyScope] to be used by a program when querying policy settings.
DefinitionMapOf returns a [DefinitionMap] with the specified settings, or an error if any settings have the same key but different type or scope.
DefinitionOf returns a setting definition by key, or [ErrNoSuchKey] if the specified key does not exist, or an error if there are conflicting policy definitions.
Definitions returns all registered setting definitions, or an error if different policies were registered under the same name.
MaybeErrorText returns an [ErrorText] with the text of the specified error, or nil if err is nil, [ErrNotConfigured], or [ErrNoSuchKey].
MergeSnapshots returns a [Snapshot] that contains all [RawItem]s from snapshot1 and snapshot2 and the [Summary] with the narrower [PolicyScope].
NewDefinition returns a new [Definition] with the specified key, scope, type and supported platforms (see [PlatformList]).
NewErrorText returns a [ErrorText] with the specified error message.
NewNamedOrigin returns a new [Origin] with the specified scope and name.
NewOrigin returns a new [Origin] with the specified scope.
NewSnapshot returns a new [Snapshot] with the specified items and options.
RawItemOf returns a [RawItem] with the specified value.
RawItemWith returns a [RawItem] with the specified value, error and origin.
RawValueOf returns a new [RawValue] holding the specified value.
Register registers a policy setting with the specified key, scope, value type, and an optional list of supported platforms.
RegisterDefinition is like [Register], but accepts a [Definition].
SetDefaultScope attempts to set the specified scope as the default scope to be used by a program when querying policy settings.
SetDefinitionsForTest allows to register the specified setting definitions for the test duration.
SummaryWith returns a [Summary] with the specified options.
UserScopeOf returns a policy [PolicyScope] of the user with the specified id.
# Constants
No description provided by the author
BooleanValue indicates a policy setting whose underlying type is a bool.
DeviceSetting indicates a policy setting that applies to a device, regardless of which OS user or Tailscale profile is currently active, if any.
DurationValue indicates an interval/period/duration policy setting whose underlying type is a string, but the actual value is a [time.Duration].
No description provided by the author
IntegerValue indicates a policy setting whose underlying type is a uint64.
InvalidValue indicates an invalid policy setting value type.
KeyPathSeparator allows logical grouping of policy settings into categories.
No description provided by the author
must be the last value in the const block.
PreferenceOptionValue indicates a three-state policy setting whose underlying type is a string, but the actual value is a [PreferenceOption].
ProfileSetting indicates a policy setting that applies to a Tailscale profile.
No description provided by the author
StringListValue indicates a policy setting whose underlying type is a []string.
StringValue indicates a policy setting whose underlying type is a string.
UserSetting indicates a policy setting that applies to users.
VisibilityValue indicates a two-state boolean-like policy setting whose underlying type is a string, but the actual value is a [Visibility].
No description provided by the author
# Variables
CurrentProfileScope indicates a scope containing policies that apply to the currently active Tailscale profile.
CurrentUserScope indicates a scope containing policies that apply to the current user, for whatever that means on the current platform and in the current application context.
DeviceScope indicates a scope containing device-global policies.
ErrNoSuchKey is returned by [DefinitionOf] when no policy setting has been registered with the specified key.
ErrNotConfigured is returned when the requested policy setting is not configured.
ErrTypeMismatch is returned when there's a type mismatch between the actual type of the setting value and the expected type.
# Structs
Definition defines policy key, scope and value type.
Origin describes where a policy or a policy setting is configured.
PolicyScope is a management scope.
RawItem contains a raw policy setting value as read from a policy store, or an error if the requested setting could not be read from the store.
RawValue represents a raw policy setting value read from a policy store.
Snapshot is an immutable collection of ([Key], [RawItem]) pairs, representing a set of policy settings applied at a specific moment in time.
Summary is an immutable [PolicyScope] and [Origin].
# Interfaces
RawValueType is a constraint that permits raw setting value types.
SummaryOption is an option that configures [Summary] The following are allowed options:
- [Summary] - [PolicyScope] - [Origin].
ValueType is a constraint that allows Go types corresponding to [Type].
# Type aliases
DefinitionMap is a map of setting [Definition] by [Key].
ErrorText represents an error that occurs when reading or parsing a policy setting.
Key is a string that uniquely identifies a policy and must remain unchanged once established and documented for a given policy setting.
PlatformList is a list of OSes.
PreferenceOption is a policy that governs whether a boolean variable is forcibly assigned an administrator-defined value, or allowed to receive a user-defined value.
RawValues is a map of keyed setting values that can be read from a JSON.
Scope indicates the broadest scope at which a policy setting may apply, and the narrowest scope at which it may be configured.
Type is a policy setting value type.
Visibility is a policy that controls whether or not a particular component of a user interface is to be shown.