package feature
import "tailscale.com/feature"
Package feature tracks which features are linked into the binary.
Index ¶
- func Register(name string)
- type Hook
- func (h *Hook[Func]) Get() Func
- func (h *Hook[Func]) GetOk() (f Func, ok bool)
- func (h *Hook[Func]) IsSet() bool
- func (h *Hook[Func]) Set(f Func)
- type Hooks
Functions ¶
func Register ¶
func Register(name string)
Register notes that the named feature is linked into the binary.
Types ¶
type Hook ¶
type Hook[Func any] struct { // contains filtered or unexported fields }
Hook is a func that can only be set once.
It is not safe for concurrent use.
func (*Hook[Func]) Get ¶
func (h *Hook[Func]) Get() Func
Get returns the hook function, or panics if it hasn't been set. Use IsSet to check if it's been set.
func (*Hook[Func]) GetOk ¶
GetOk returns the hook function and true if it has been set, otherwise its zero value and false.
func (*Hook[Func]) IsSet ¶
IsSet reports whether the hook has been set.
func (*Hook[Func]) Set ¶
func (h *Hook[Func]) Set(f Func)
Set sets the hook function, panicking if it's already been set or f is the zero value.
It's meant to be called in init.
type Hooks ¶
type Hooks[Func any] []Func
Hooks is a slice of funcs.
As opposed to a single Hook, this is meant to be used when multiple parties are able to install the same hook.
func (*Hooks[Func]) Add ¶
func (h *Hooks[Func]) Add(f Func)
Add adds a hook to the list of hooks.
Add should only be called during early program startup before Tailscale has started. It is not safe for concurrent use.
Source Files ¶
feature.go
Directories ¶
Path | Synopsis |
---|---|
feature/capture | Package capture formats packet logging into a debug pcap stream. |
feature/capture/dissector | Package dissector contains the Lua dissector for Tailscale packets. |
feature/condregister | The condregister package registers all conditional features guarded by build tags. |
feature/relayserver | Package relayserver registers the relay server feature and implements its associated ipnext.Extension. |
feature/taildrop | Package taildrop registers the taildrop (file sending) feature. |
feature/tap | Package tap registers Tailscale's experimental (demo) Linux TAP (Layer 2) support. |
feature/tpm | Package tpm implements support for TPM 2.0 devices. |
feature/wakeonlan | Package wakeonlan registers the Wake-on-LAN feature. |
- Version
- v1.84.1 (latest)
- Published
- May 29, 2025
- Platform
- linux/amd64
- Imports
- 1 packages
- Last checked
- 1 day ago –
Tools for package owners.