Documentation
¶
Overview ¶
Package updatecheck surfaces a soft "newer version available" notice when ketch is run interactively. It caches release metadata locally so the network check happens at most once per day, and the hint only appears when the cached status is recent.
Respect: KETCH_NO_UPDATE_NOTIFIER=1 disables everything; the CI env var also suppresses notices automatically.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Disabled ¶
func Disabled() bool
Disabled reports whether the user has opted out of update checks.
func FormatNotice ¶
FormatNotice renders the short two-line reminder printed to stderr.
func MarkNotified ¶
MarkNotified records that the user has been shown the current status.
func ShouldNotify ¶
ShouldNotify reports whether the passive notice should be shown. The notice is suppressed if the same version was already announced within the notifyTTL window.
Types ¶
type InstallType ¶
type InstallType string
const ( InstallUnknown InstallType = "unknown" InstallHomebrew InstallType = "homebrew" InstallGo InstallType = "go" InstallManual InstallType = "manual" )
type Status ¶
type Status struct {
CheckedAt time.Time `json:"checked_at,omitempty"`
CacheStale bool `json:"cache_stale"`
Available bool `json:"available"`
LatestVersion string `json:"latest_version,omitempty"`
InstallType InstallType `json:"install_type,omitempty"`
Command string `json:"command,omitempty"`
ReleaseURL string `json:"release_url,omitempty"`
Source string `json:"source,omitempty"`
}