Versions in this module Expand all Collapse all v0 v0.51.8 Oct 4, 2026 Changes in this version + const NMConnectionDir + const NetplanFile + const RetryBackoff + const VerdictInPlace + const VerdictMoved + const VerdictUnknown + const WatchService + const WatchTimer + var ErrNoBackend = errors.New(...) + var ErrNoWirelessInterface = errors.New(...) + func AcquireLock(workspace string, now time.Time) (release func(), ok bool, err error) + func NMKeyfile(credential Credential) []byte + func NetplanAdd(existing []byte, credential Credential) ([]byte, error) + func NetplanList(existing []byte) ([]string, error) + func NetplanRemove(existing []byte, ssid string) (out []byte, found bool, err error) + func ParseDefaultRoute(raw []byte) (iface, gateway string) + func ParseIWLinkSSID(out []byte) string + func ParseNMCLIActiveSSID(out []byte) string + func RenderWatchService(cfg WatchConfig) string + func RenderWatchTimer() string + func SaveState(workspace string, state State) error + func SetWatchOptOut(workspace string, optedOut bool) error + func Verdict(current string, recorded ...string) string + func WatchOptedOut(workspace string) bool + func WirelessInterfaces(sys Sys) []string + type Backend interface + Add func(ctx context.Context, credential Credential, applyNow bool) error + List func() ([]Network, error) + Name func() string + Remove func(ctx context.Context, ssid string, applyNow bool) (bool, error) + func DetectBackend(ctx context.Context, sys Sys) (Backend, error) + type Credential struct + Password string + Priority int + SSID string + func (c Credential) Validate() error + type NMBackend struct + Dir string + Sys Sys + func (b *NMBackend) Add(ctx context.Context, credential Credential, _ bool) error + func (b *NMBackend) List() ([]Network, error) + func (b *NMBackend) Name() string + func (b *NMBackend) Remove(ctx context.Context, ssid string, _ bool) (bool, error) + type NetplanBackend struct + Path string + Sys Sys + func (b *NetplanBackend) Add(ctx context.Context, credential Credential, applyNow bool) error + func (b *NetplanBackend) List() ([]Network, error) + func (b *NetplanBackend) Name() string + func (b *NetplanBackend) Remove(ctx context.Context, ssid string, applyNow bool) (bool, error) + type Network struct + Backend string + Priority int + SSID string + type Observation struct + Address string + Gateway string + Interface string + SSID string + Wireless bool + func Observe(ctx context.Context, sys Sys) Observation + type State struct + ApplyPending bool + LastAddress string + LastAttempt time.Time + LastError string + LastFailed bool + func LoadState(workspace string) State + func (s State) ShouldBackOff(now time.Time) bool + type Sys struct + Discover func() (netip.Addr, error) + Exists func(string) bool + Glob func(string) ([]string, error) + LookPath func(string) (string, error) + ReadFile func(string) ([]byte, error) + Run func(ctx context.Context, name string, args ...string) ([]byte, error) + func DefaultSys() Sys + type WatchConfig struct + Binary string + Home string + Path string + Spec string + Workspace string + type WatchInstaller struct + Sys Sys + UnitDir string + func DefaultWatchInstaller() WatchInstaller + func (w WatchInstaller) Disable(ctx context.Context) (removed bool, err error) + func (w WatchInstaller) Enable(ctx context.Context, cfg WatchConfig) (changed bool, err error) + func (w WatchInstaller) Status(ctx context.Context) WatchStatus + func (w WatchInstaller) WatchSupported() bool + type WatchStatus struct + Active bool + Enabled bool + Installed bool + Unit string