Documentation
¶
Overview ¶
Package updatecheck periodically asks GitHub whether a newer Mooring release exists and — critically — whether the RUNNING version is affected by a published security advisory, so the operator is told to update (and paged, for a security advisory) even when nobody is watching the dashboard. It is OPT-IN: with the check disabled it never contacts the network. When enabled it contacts ONLY the GitHub API and sends no telemetry payload (plain GETs of public release/advisory data).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdvisoryState ¶
type AdvisoryState struct {
GHSAID string
Severity string
Summary string
URL string
Patched string
}
AdvisoryState describes the published security advisory affecting the running version.
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker periodically asks GitHub whether a newer Mooring exists and whether the running version is affected by a published security advisory.
func New ¶
func New(gh ghAPI, owner, repo, version string, interval time.Duration, alerts alertSink, log *slog.Logger) *Checker
New builds a Checker. interval is clamped to a sane floor by Run.
type State ¶
type State struct {
Checked bool
At time.Time
RunningVersion string
LatestVersion string
LatestURL string
UpdateAvailable bool
Advisory *AdvisoryState // non-nil ⇒ the RUNNING version is vulnerable — update now
LastError string
}
State is the current update posture the dashboard banner renders. Held in an atomic pointer and read (cheaply) on every page render.