Documentation
¶
Overview ¶
Package version reports which Bespoke release a process is running and whether a newer one has been published (ADR-0034). The running release comes from the build's module graph — an instance pins the platform in go.mod (ADR-0027), so nothing has to be stamped in at build time.
Index ¶
Constants ¶
const Dev = "dev"
Dev is reported when the build carries no release pin: a working tree, a `go run`, or a replace/go.work override.
const Module = "github.com/bketelsen/bespoke"
Module is the public platform module path (ADR-0027).
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker caches the newest published release. It is safe for concurrent use and never blocks a request: checks happen in the background and every failure is soft — an instance with no outbound network still renders its own version.
func NewChecker ¶
func NewChecker() *Checker
NewChecker returns a Checker for the running platform release. Dev builds have no release to compare against, and BESPOKE_UPDATE_CHECK=off drops the outbound call entirely (the footer then shows the running version alone).
type Info ¶
type Info struct {
// Current is the running release, or Dev.
Current string
// Latest is the newest published release; empty until a check succeeds
// and whenever checking is off.
Latest string
// URL is Latest's release page, empty alongside Latest.
URL string
// Outdated reports that Latest is a newer release than Current.
Outdated bool
}
Info is the version state a UI renders.