Documentation
¶
Overview ¶
Package feature tracks which features are linked into the binary.
Index ¶
Constants ¶
const CanSystemdStatus = runtime.GOOS == "linux" && buildfeatures.HasSDNotify
CanSystemdStatus reports whether the current build has systemd notifications linked in.
It's effectively the same as HookSystemdStatus.IsSet(), but a constant for dead code elimination reasons.
Variables ¶
Functions ¶
func CanAutoUpdate ¶ added in v1.90.0
func CanAutoUpdate() bool
CanAutoUpdate reports whether the current binary is built with auto-update support and, if so, whether the current platform supports it.
func HardwareAttestationAvailable ¶ added in v1.90.0
func HardwareAttestationAvailable() bool
HardwareAttestationAvailable reports whether hardware attestation is supported and available (TPM on Windows/Linux, Secure Enclave on macOS|iOS, KeyStore on Android)
func Register ¶
func Register(name string)
Register notes that the named feature is linked into the binary.
func Registered ¶ added in v1.90.4
Registered reports the set of registered features.
The returned map should not be modified by the caller, not accessed concurrently with calls to Register.
func SystemdStatus ¶ added in v1.90.0
SystemdStatus sends a single line status update to systemd so that information shows up in systemctl output.
It does nothing on non-Linux systems or if the binary was built without the sdnotify feature.
func TPMAvailable ¶ added in v1.90.0
func TPMAvailable() bool
TPMAvailable reports whether a TPM device is supported and available.
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.
HookCanAutoUpdate is a hook for the clientupdate package to conditionally initialize.
HookHardwareAttestationAvailable is a hook that reports whether hardware attestation is supported and available.
HookProxyFromEnvironment is a hook for feature/useproxy to register a function to use as http.ProxyFromEnvironment.
HookProxyGetAuthHeader is a hook for feature/useproxy to register [tshttpproxy.GetAuthHeader].
var HookProxyInvalidateCache Hook[func()]
HookProxyInvalidateCache is a hook for feature/useproxy to register [tshttpproxy.InvalidateCache].
HookProxySetSelfProxy is a hook for feature/useproxy to register [tshttpproxy.SetSelfProxy].
HookProxySetTransportGetProxyConnectHeader is a hook for feature/useproxy to register [tshttpproxy.SetTransportGetProxyConnectHeader].
var HookSystemdReady Hook[func()]
HookSystemdReady sends a readiness to systemd. This will unblock service dependents from starting.
HookSystemdStatus holds a func that will send a single line status update to systemd so that information shows up in systemctl output.
HookTPMAvailable is a hook that reports whether a TPM device is supported and available.
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, or use GetOrNil if you're okay with a nil return value.
func (*Hook[Func]) GetOk ¶ added in v1.84.0
GetOk returns the hook function and true if it has been set, otherwise its zero value and false.
func (*Hook[Func]) GetOrNil ¶ added in v1.90.0
func (h *Hook[Func]) GetOrNil() Func
GetOrNil returns the hook function or nil if it hasn't 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.
func (*Hook[Func]) SetForTest ¶ added in v1.92.0
func (h *Hook[Func]) SetForTest(f Func) (restore func())
SetForTest sets the hook function for tests, blowing away any previous value. It will panic if called from non-test code.
It returns a restore function that resets the hook to its previous value.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package ace registers support for Alternate Connectivity Endpoints (ACE).
|
Package ace registers support for Alternate Connectivity Endpoints (ACE). |
|
Package appconnectors registers support for Tailscale App Connectors.
|
Package appconnectors registers support for Tailscale App Connectors. |
|
The buildfeatures package contains boolean constants indicating which features were included in the binary (via build tags), for use in dead code elimination when using separate build tag protected files is impractical or undesirable.
|
The buildfeatures package contains boolean constants indicating which features were included in the binary (via build tags), for use in dead code elimination when using separate build tag protected files is impractical or undesirable. |
|
Package c2n registers support for C2N (Control-to-Node) communications.
|
Package c2n registers support for C2N (Control-to-Node) communications. |
|
Package capture formats packet logging into a debug pcap stream.
|
Package capture formats packet logging into a debug pcap stream. |
|
dissector
Package dissector contains the Lua dissector for Tailscale packets.
|
Package dissector contains the Lua dissector for Tailscale packets. |
|
Package clientupdate enables the client update feature.
|
Package clientupdate enables the client update feature. |
|
condlite
|
|
|
expvar
Package expvar contains type aliases for expvar types, to allow conditionally excluding the package from builds.
|
Package expvar contains type aliases for expvar types, to allow conditionally excluding the package from builds. |
|
The condregister package registers all conditional features guarded by build tags.
|
The condregister package registers all conditional features guarded by build tags. |
|
identityfederation
Package identityfederation registers support for authkey resolution via identity federation if it's not disabled by the ts_omit_identityfederation build tag.
|
Package identityfederation registers support for authkey resolution via identity federation if it's not disabled by the ts_omit_identityfederation build tag. |
|
oauthkey
Package oauthkey registers support for OAuth key resolution if it's not disabled via the ts_omit_oauthkey build tag.
|
Package oauthkey registers support for OAuth key resolution if it's not disabled via the ts_omit_oauthkey build tag. |
|
portmapper
Package portmapper registers support for portmapper if it's not disabled via the ts_omit_portmapper build tag.
|
Package portmapper registers support for portmapper if it's not disabled via the ts_omit_portmapper build tag. |
|
useproxy
Package useproxy registers support for using proxies if it's not disabled via the ts_omit_useproxy build tag.
|
Package useproxy registers support for using proxies if it's not disabled via the ts_omit_useproxy build tag. |
|
Package debugportmapper registers support for debugging Tailscale's portmapping support.
|
Package debugportmapper registers support for debugging Tailscale's portmapping support. |
|
The doctor package registers the "doctor" problem diagnosis support into the rest of Tailscale.
|
The doctor package registers the "doctor" problem diagnosis support into the rest of Tailscale. |
|
Package drive registers the Taildrive (file server) feature.
|
Package drive registers the Taildrive (file server) feature. |
|
The featuretags package is a registry of all the ts_omit-able build tags.
|
The featuretags package is a registry of all the ts_omit-able build tags. |
|
Package identityfederation registers support for using ID tokens to automatically request authkeys for logging in.
|
Package identityfederation registers support for using ID tokens to automatically request authkeys for logging in. |
|
Package linkspeed registers support for setting the TUN link speed on Linux, to better integrate with system monitoring tools.
|
Package linkspeed registers support for setting the TUN link speed on Linux, to better integrate with system monitoring tools. |
|
Package linuxdnsfight provides Linux support for detecting DNS fights (inotify watching of /etc/resolv.conf).
|
Package linuxdnsfight provides Linux support for detecting DNS fights (inotify watching of /etc/resolv.conf). |
|
Package oauthkey registers support for using OAuth client secrets to automatically request authkeys for logging in.
|
Package oauthkey registers support for using OAuth client secrets to automatically request authkeys for logging in. |
|
Package portlist contains code to poll the local system for open ports and report them to the control plane, if enabled on the tailnet.
|
Package portlist contains code to poll the local system for open ports and report them to the control plane, if enabled on the tailnet. |
|
Package portmapper registers support for NAT-PMP, PCP, and UPnP port mapping protocols to help get direction connections through NATs.
|
Package portmapper registers support for NAT-PMP, PCP, and UPnP port mapping protocols to help get direction connections through NATs. |
|
Package posture registers support for device posture checking, reporting machine-specific information to the control plane when enabled by the user and tailnet.
|
Package posture registers support for device posture checking, reporting machine-specific information to the control plane when enabled by the user and tailnet. |
|
Package relayserver registers the relay server feature and implements its associated ipnext.Extension.
|
Package relayserver registers the relay server feature and implements its associated ipnext.Extension. |
|
Package sdnotify contains a minimal wrapper around systemd-notify to enable applications to signal readiness and status to systemd.
|
Package sdnotify contains a minimal wrapper around systemd-notify to enable applications to signal readiness and status to systemd. |
|
Package syspolicy provides an interface for system-wide policy management.
|
Package syspolicy provides an interface for system-wide policy management. |
|
Package taildrop registers the taildrop (file sending) feature.
|
Package taildrop registers the taildrop (file sending) feature. |
|
Package tap registers Tailscale's experimental (demo) Linux TAP (Layer 2) support.
|
Package tap registers Tailscale's experimental (demo) Linux TAP (Layer 2) support. |
|
Package tpm implements support for TPM 2.0 devices.
|
Package tpm implements support for TPM 2.0 devices. |
|
Package useproxy registers support for using system proxies.
|
Package useproxy registers support for using system proxies. |
|
Package wakeonlan registers the Wake-on-LAN feature.
|
Package wakeonlan registers the Wake-on-LAN feature. |