options.go 503 B

12345678910111213141516171819202122
  1. // Copyright (c) Tailscale Inc & AUTHORS
  2. // SPDX-License-Identifier: BSD-3-Clause
  3. package prefs
  4. // Options are used to configure additional parameters of a preference.
  5. type Options func(s *metadata)
  6. var (
  7. // ReadOnly is an option that marks preference as read-only.
  8. ReadOnly Options = markReadOnly
  9. // Managed is an option that marks preference as managed.
  10. Managed Options = markManaged
  11. )
  12. func markReadOnly(s *metadata) {
  13. s.ReadOnly = true
  14. }
  15. func markManaged(s *metadata) {
  16. s.Managed = true
  17. }