feature
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package feature tracks which features are linked into the binary.
Index¶
Constants¶
const CanSystemdStatus =runtime.GOOS == "linux" &&buildfeatures.HasSDNotifyCanSystemdStatus reports whether the current build has systemd notificationslinked in.
It's effectively the same as HookSystemdStatus.IsSet(), but a constant fordead code elimination reasons.
Variables¶
var ErrUnavailable =errors.New("feature not included in this build")Functions¶
funcCanAutoUpdate¶added inv1.90.0
func CanAutoUpdate()bool
CanAutoUpdate reports whether the current binary is built with auto-updatesupport and, if so, whether the current platform supports it.
funcHardwareAttestationAvailable¶added inv1.90.0
func HardwareAttestationAvailable()bool
HardwareAttestationAvailable reports whether hardware attestation issupported and available (TPM on Windows/Linux, Secure Enclave on macOS|iOS,KeyStore on Android)
funcRegister¶
func Register(namestring)
Register notes that the named feature is linked into the binary.
funcRegistered¶added inv1.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.
funcSystemdStatus¶added inv1.90.0
SystemdStatus sends a single line status update to systemd so thatinformation shows up in systemctl output.
It does nothing on non-Linux systems or if the binary was built withoutthe sdnotify feature.
funcTPMAvailable¶added inv1.90.0
func TPMAvailable()bool
TPMAvailable reports whether a TPM device is supported and available.
Types¶
typeHook¶
type Hook[Funcany] 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 packageto conditionally initialize.
HookHardwareAttestationAvailable is a hook that reports whether hardwareattestation is supported and available.
HookProxyFromEnvironment is a hook for feature/useproxy to registera function to use as http.ProxyFromEnvironment.
HookProxyGetAuthHeader is a hook for feature/useproxy to register[tshttpproxy.GetAuthHeader].
var HookProxyInvalidateCacheHook[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 HookSystemdReadyHook[func()]HookSystemdReady sends a readiness to systemd. This will unblock servicedependents from starting.
HookSystemdStatus holds a func that will send a single line status update tosystemd so that information shows up in systemctl output.
HookTPMAvailable is a hook that reports whether a TPM device is supportedand 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'reokay with a nil return value.
func (*Hook[Func])GetOk¶added inv1.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 inv1.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 setor f is the zero value.
It's meant to be called in init.
func (*Hook[Func])SetForTest¶added inv1.92.0
func (h *Hook[Func]) SetForTest(f Func) (restore func())
SetForTest sets the hook function for tests, blowingaway any previous value. It will panic if called fromnon-test code.
It returns a restore function that resets the hookto 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. |