Documentation
¶
Overview ¶
Package updatecheck tells a person running an old release that a newer one exists. The check is a convenience, so nothing here returns an error: a failed lookup or an unreadable cache means loupe says nothing.
Index ¶
- Constants
- func Available(current, latest string) string
- func CachePath(root string) string
- func Cached(path string) string
- func Enabled(current string, getenv func(string) string) bool
- func IsRelease(version string) bool
- func Refresh(ctx context.Context, path string, now time.Time, lookup Lookup)
- type Lookup
Constants ¶
const ( // Owner and Repo name the repository whose latest release is checked. Owner = "secondshift-labs" Repo = "loupe" // Command is what a warning tells a person to run. It refuses an install it cannot update, with that install's fix. Command = "loupe update" // CheckInterval is the least time between lookups. CheckInterval = 24 * time.Hour // LookupTimeout is the most a lookup may add to a command. LookupTimeout = 2 * time.Second // DisableEnv, when set, stops the check, the warning and the notice. DisableEnv = "LOUPE_NO_UPDATE_CHECK" )
Variables ¶
This section is empty.
Functions ¶
func Available ¶
Available says that latest is newer than current, or returns nothing. It compares when read, not when cached, so an upgrade clears it at once.
func CachePath ¶
CachePath is a file at the data root, outside the runs directory that run.Walk lists.
func Enabled ¶
Enabled is false for a build that is not a release and for a CI job, which pins its version on purpose.