mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-14 23:17:29 +00:00
util/syspolicy: add read boolean setting (#9592)
This commit is contained in:
@@ -19,6 +19,8 @@ type Handler interface {
|
||||
ReadString(key string) (string, error)
|
||||
// ReadUInt64 reads the policy settings uint64 value given the key.
|
||||
ReadUInt64(key string) (uint64, error)
|
||||
// ReadBool reads the policy setting's boolean value, given the key.
|
||||
ReadBoolean(key string) (bool, error)
|
||||
}
|
||||
|
||||
// ErrNoSuchKey is returned when the specified key does not have a value set.
|
||||
@@ -35,6 +37,10 @@ func (defaultHandler) ReadUInt64(_ string) (uint64, error) {
|
||||
return 0, ErrNoSuchKey
|
||||
}
|
||||
|
||||
func (defaultHandler) ReadBoolean(_ string) (bool, error) {
|
||||
return false, ErrNoSuchKey
|
||||
}
|
||||
|
||||
// markHandlerInUse is called before handler methods are called.
|
||||
func markHandlerInUse() {
|
||||
handlerUsed.Store(true)
|
||||
|
Reference in New Issue
Block a user