Documentation
¶
Overview ¶
Package update checks GitHub for newer releases and can replace the running binary in place. Policy here (version comparison, throttling, whether to check) is pure and offline; the network and self-replace work lives in remote.go.
Index ¶
- Constants
- func Apply(ctx context.Context, current string) (string, error)
- func DefaultCachePath() (string, error)
- func Due(c Cache, now time.Time, interval time.Duration) bool
- func Latest(ctx context.Context) (string, error)
- func Newer(current, latest string) bool
- func Save(path string, c Cache) error
- func ShouldCheck(noFlag bool, env, version string) bool
- type Cache
Constants ¶
const CheckInterval = 24 * time.Hour
CheckInterval is the minimum time between real GitHub queries.
Variables ¶
This section is empty.
Functions ¶
func Apply ¶
Apply updates the running binary to the latest release if it is newer than current. It returns the new version on success, or ("", nil) when already up to date. The running executable is replaced atomically by go-selfupdate.
func DefaultCachePath ¶
DefaultCachePath returns ~/.nvim-quest/update-check.json.
func Latest ¶
Latest returns the newest release version tag (e.g. "v0.2.0"), or "" if none is found.
func Newer ¶
Newer reports whether latest is strictly newer than current. It returns false for a "dev" build or any unparseable version (used by the launch-time notice).
func ShouldCheck ¶
ShouldCheck reports whether the launch-time update check should run. It is skipped when explicitly disabled (flag or env var) and for unversioned dev builds (which can't meaningfully compare against a release).