Documentation
¶
Overview ¶
Package updatecheck asks GitHub, once a day, whether a newer Miabi release exists and caches the answer for the dashboard to read.
It notifies; it never upgrades. This process holds the Docker socket and orchestrates every workspace, so restarting itself into a new image is a decision for a human with a shell, not a cron tick.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNewer ¶ added in v1.4.0
IsNewer reports whether latest is a strictly newer release than current.
Readers use this to gate the notice rather than trusting the cached row on its own. The row is written by a daily cron, so between an upgrade and the next tick it still describes the *previous* build — without this guard an install that just moved to 1.3.0 would keep advertising the v1.2.1 it is already past. Comparing at read time makes offering a downgrade structurally impossible, whatever is cached.
A non-version build ("dev", a sha) compares against nothing: false.
Types ¶
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
HTMLURL string `json:"html_url"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
PublishedAt time.Time `json:"published_at"`
}
Release is the subset of GitHub's release object we rely on.
func Newest ¶
Newest picks the newest release the running build should be offered, or "" when none is newer. Exported for tests.
Ordering is semver, never lexical: "v1.0.0-beta.10" sorts *after* "v1.0.0-beta.9" here, and "v1.0.0" after both — a string compare gets both backwards, which would tell a beta.10 user to "upgrade" to beta.9.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service performs the check and persists its result.
func (*Service) Check ¶
Check fetches the release list and updates the cached row. Errors are stored on the row rather than returned to a user: an air-gapped install fails this every day, and that must be visible to an admin without being noisy.
func (*Service) Dismiss ¶
Dismiss silences the notice for a specific version. Recording the version — rather than a boolean — means the next release notifies again.