Documentation
¶
Overview ¶
Package update replaces an installed bundle with a newer published release, and reports that one exists without installing it.
Index ¶
Constants ¶
const ( Repository = "Luqueee/kivgraph" DefaultAPIBase = "https://api.github.com" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NoticeOptions ¶
type NoticeOptions struct {
Client *http.Client
APIBaseURL string
Token string
CurrentVersion string
CachePath string
CacheTTL time.Duration
Timeout time.Duration
Now func() time.Time
}
NoticeOptions controls the non-mutating release lookup used by the bare CLI invocation. It deliberately has a shorter timeout and a cache unlike Run, because checking for an update must never make a local command feel remote.
type NoticeResult ¶
type NoticeResult struct {
CurrentVersion string
LatestVersion string
UpdateAvailable bool
FromCache bool
}
NoticeResult is the part of Result that the CLI needs to decide whether to print an update hint. FromCache makes the source observable to callers and tests without exposing the cache representation.
func CheckNotice ¶
func CheckNotice(ctx context.Context, options NoticeOptions) (NoticeResult, error)
CheckNotice checks the latest published release at most once per cache TTL. It never installs a release. A caller may treat a returned error as non-fatal when the notice is merely an optional terminal convenience.
type Options ¶
type Options struct {
Client *http.Client
APIBaseURL string
Token string
CurrentVersion string
ExecutablePath string
CheckOnly bool
}
Options controls a release lookup and, unless CheckOnly is true, an atomic replacement of the currently installed bundle.