ptype
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package ptype contains types used by syspolicy.
It's a leaf package for dependency reasons and should not contain much if anycode, and should not import much (or anything).
Index¶
- type PreferenceOption
- func (p PreferenceOption) IsAlways() bool
- func (p PreferenceOption) IsNever() bool
- func (p *PreferenceOption) MarshalText() (text []byte, err error)
- func (p PreferenceOption) ShouldEnable(userChoice bool) bool
- func (p PreferenceOption) Show() bool
- func (p PreferenceOption) String() string
- func (p *PreferenceOption) UnmarshalText(text []byte) error
- func (p PreferenceOption) WillOverride(userChoice bool) bool
- type Visibility
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
This section is empty.
Types¶
typePreferenceOption¶
type PreferenceOptionbyte
PreferenceOption is a policy that governs whether a boolean variableis forcibly assigned an administrator-defined value, or allowed to receivea user-defined value.
const (ShowChoiceByPolicyPreferenceOption =iotaNeverByPolicyAlwaysByPolicy)
func (PreferenceOption)IsAlways¶
func (pPreferenceOption) IsAlways()bool
IsAlways reports whether the preference should always be enabled.
func (PreferenceOption)IsNever¶
func (pPreferenceOption) IsNever()bool
IsNever reports whether the preference should always be disabled.
func (*PreferenceOption)MarshalText¶
func (p *PreferenceOption) MarshalText() (text []byte, errerror)
MarshalText implementsencoding.TextMarshaler.
func (PreferenceOption)ShouldEnable¶
func (pPreferenceOption) ShouldEnable(userChoicebool)bool
ShouldEnable checks if the choice administered by this policy should beenabled. If the administrator has chosen a setting, the administrator'ssetting is returned, otherwise userChoice is returned.
func (PreferenceOption)Show¶
func (pPreferenceOption) Show()bool
Show reports whether the UI option that controls the choice administered bythis policy should be shown (that is, available for users to change).
Currently this is true if and only if the policy isShowChoiceByPolicy.
func (PreferenceOption)String¶
func (pPreferenceOption) String()string
String returns a string representation of p.
func (*PreferenceOption)UnmarshalText¶
func (p *PreferenceOption) UnmarshalText(text []byte)error
UnmarshalText implementsencoding.TextUnmarshaler.It never fails and sets p toShowChoiceByPolicy if the specified textdoes not represent a validPreferenceOption.
func (PreferenceOption)WillOverride¶
func (pPreferenceOption) WillOverride(userChoicebool)bool
WillOverride checks if the choice administered by the policy is differentfrom the user's choice.
typeVisibility¶
type Visibilitybyte
Visibility is a policy that controls whether or not a particularcomponent of a user interface is to be shown.
const (VisibleByPolicyVisibility = 'v'HiddenByPolicyVisibility = 'h')
func (Visibility)MarshalText¶
func (vVisibility) MarshalText() (text []byte, errerror)
MarshalText implementsencoding.TextMarshaler.
func (Visibility)Show¶
func (vVisibility) Show()bool
Show reports whether the UI option administered by this policy should be shown.Currently this is true if the policy is not [hiddenByPolicy].
func (Visibility)String¶
func (vVisibility) String()string
String returns a string representation of v.
func (*Visibility)UnmarshalText¶
func (v *Visibility) UnmarshalText(text []byte)error
UnmarshalText implementsencoding.TextUnmarshaler.It never fails and sets v toVisibleByPolicy if the specified textdoes not represent a validVisibility.