linux

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package linux implements the NetworkProvider for Linux via NetworkManager's nmcli. Every OS call goes through a sys.Runner, so the orchestration is tested against fixtures (see *_test.go) without NetworkManager or a radio.

Scan          -> nmcli -t -f ACTIVE,SSID,BSSID,SIGNAL,FREQ,CHAN,SECURITY dev wifi list
KnownNetworks -> nmcli -t -f NAME,TYPE con show
Current       -> the ACTIVE row from Scan + ping to the default-route gateway

nmcli reports SIGNAL as a 0–100 quality percentage; we map it to dBm as the inverse of model.SignalPct. PHY mode is not exposed, so Capabilities reports PHYMode false and the scorer skips it.

Fallback for non-NetworkManager systems: `iw` / wpa_supplicant (see github.com/theojulienne/go-wireless).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

func New

func New() *Provider

func (*Provider) Capabilities

func (p *Provider) Capabilities() model.Capabilities

func (*Provider) Current

func (p *Provider) Current(ctx context.Context) (*model.Network, error)

func (*Provider) KnownNetworks

func (p *Provider) KnownNetworks(ctx context.Context) ([]model.SavedNetwork, error)

func (*Provider) Scan

func (p *Provider) Scan(ctx context.Context) ([]model.Network, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL