summaryrefslogtreecommitdiffhomepage
path: root/types/prefs/options.go
blob: bc0123a526084ec5a3e1260e169beb9a4f730448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright (c) Tailscale Inc & contributors
// SPDX-License-Identifier: BSD-3-Clause

package prefs

// Options are used to configure additional parameters of a preference.
type Options func(s *metadata)

var (
	// ReadOnly is an option that marks preference as read-only.
	ReadOnly Options = markReadOnly
	// Managed is an option that marks preference as managed.
	Managed Options = markManaged
)

func markReadOnly(s *metadata) {
	s.ReadOnly = true
}

func markManaged(s *metadata) {
	s.Managed = true
}