Documentation
¶
Overview ¶
Package update reports whether a newer openobserve-cli release is available.
It is a passive, opt-in check: nothing here runs unless a caller (the root post-run notice, or `doctor`) explicitly invokes it. A failed check never returns an error — it degrades into an informational Status — so an offline or rate-limited environment never turns a routine command into a failure.
Index ¶
Constants ¶
const DefaultEndpoint = "https://api.github.com/repos/AngelMsger/openobserve-cli/releases/latest"
DefaultEndpoint is the GitHub API URL for the latest published release.
const EndpointEnv = "OPENOBSERVE_RELEASE_API"
EndpointEnv overrides DefaultEndpoint. It exists so tests (and the e2e harness) can point the check at a local server instead of GitHub.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Status ¶
type Status struct {
Current string `json:"current"`
Latest string `json:"latest,omitempty"`
Available bool `json:"available"`
Detail string `json:"detail"`
}
Status is the outcome of an update check. It is always safe to render: a failed check sets Available=false and explains itself in Detail.
func Cached ¶
Cached returns an update Status backed by a 24h on-disk cache in cacheDir. It is the per-command counterpart to Check: a fresh cache is served without any network call, and only on a miss/expiry does it perform one bounded lookup (bounded by the doer's own timeout) and rewrite the cache. A failed lookup falls back to any stale cache, and otherwise degrades to a non- available Status — it never blocks beyond the doer and never returns an error, so a routine command is never slowed or failed by the check.