Documentation
¶
Overview ¶
Package api exposes the engine's live snapshot and the store's history over HTTP, and serves the embedded dashboard. It is consumed locally by the dashboard UI (and could back a Wails/native shell later).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capturer ¶ added in v0.6.0
type Capturer interface {
ListInterfaces() []types.NetIface
PreferredInterface() string // "" means auto-detect
SetPreferredInterface(name string) error
Paused() bool
SetPaused(p bool)
}
Capturer lets the API list and switch the capture interface. Implemented by the live capture supervisor; nil for demo/offline sources (which can't switch).
type HelperInstaller ¶ added in v0.28.0
type HelperInstaller interface {
Install(req helperinstall.Request) error
}
HelperInstaller vets and installs a successor daemon binary. Implemented by internal/helperinstall; an interface here so the API package stays free of the install mechanics and tests can stub it.
type Server ¶
type Server struct {
// RestartFunc, when set, is called (in a goroutine) after the HTTP response
// is sent to /api/restart. The daemon sets this to cancel its signal context,
// which causes a clean shutdown; launchd's KeepAlive then restarts it with
// the new binary.
RestartFunc func()
// HelperInstaller, when set, lets POST /api/helper/refresh replace the
// root-owned daemon copy with a release binary the app names — after the
// installer has verified it against the release's published checksum. The
// daemon sets this only when it runs as root under launchd; nil answers
// 501 so the app falls back to its admin prompt.
HelperInstaller HelperInstaller
// contains filtered or unexported fields
}
Server wires the engine (live), store (history) and update checker to HTTP.