Documentation
¶
Overview ¶
Package update checks the mesh's version feed for a newer flockd release. It never installs anything: it tells the operator (status, SSE, CLI, TUI, desktop banner) and points at the release page. Brew users run `brew upgrade --cask tera`; signed self-update is gated on plan 01.
Index ¶
Constants ¶
const DefaultFeedURL = "https://api.teraflock.ai/v1/versions"
DefaultFeedURL is the control plane's public version feed.
Variables ¶
ErrFeedUnavailable wraps feed fetch failures (404 while the endpoint is being built, connection errors). The result is "unknown", not an error the operator sees.
Functions ¶
Types ¶
type Checker ¶
type Checker struct {
FeedURL string
// Current is the running build version (main.version).
Current string
Client *http.Client
Log *slog.Logger
// Events receives `update_available` once per newly discovered
// version. May be nil.
Events *events.Hub
// Activity gets an update_available row once per version. May be nil.
Activity *activity.Ring
// InitialDelay before the first check (lets the daemon finish booting)
// and Interval between checks. Zero = 30s / 1h.
InitialDelay time.Duration
Interval time.Duration
// contains filtered or unexported fields
}
Checker polls the feed.
type Feed ¶
type Feed struct {
Flockd struct {
Latest string `json:"latest"`
Minimum string `json:"minimum"`
URL string `json:"url"`
} `json:"flockd"`
Desktop struct {
Latest string `json:"latest"`
URL string `json:"url"`
} `json:"desktop"`
}
Feed is the version feed document:
{"flockd":{"latest":"0.4.0","minimum":"0.3.0","url":"…"},
"desktop":{"latest":"…","url":"…"}}
type Public ¶
type Public struct {
Available bool `json:"available"`
Current string `json:"current"`
Latest string `json:"latest"`
Minimum string `json:"minimum,omitempty"`
BelowMinimum bool `json:"below_minimum,omitempty"`
URL string `json:"url,omitempty"`
CheckedAt time.Time `json:"checked_at"`
}
Public is the wire shape shared by /api/v1/status.update, the update/check route and the SSE event (mirrors the Update schema).
type Result ¶
type Result struct {
// Available is true when Latest is a newer release than Current.
// Always false for dev builds (never nag a developer's own binary).
Available bool
Current string
Latest string
Minimum string
BelowMinimum bool
URL string
CheckedAt time.Time
}
Result is one completed check.