Documentation
¶
Overview ¶
Package updatecheck finds the newest published Pando release on GitHub for the running platform. It is shared by the `pando update` command and the HTTP API that tells the WebUI whether an update is available.
Index ¶
Constants ¶
const RepoSlug = "digiogithub/pando"
RepoSlug is the GitHub repository releases are published to.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Release *selfupdate.Release
Found bool
}
Result is the outcome of a release lookup. Found is false when no release carries an asset for the running platform.
func DetectLatest ¶
DetectLatest returns the newest non-draft GitHub release that ships an asset for the running platform. The lookup is abandoned when ctx is done.
func DetectVersion ¶ added in v1.0.5
DetectVersion returns the published GitHub release tagged with the given version (with or without the "v" prefix) when it ships an asset for the running platform. Found is false when the tag exists but carries no asset for this platform; a tag that does not exist is reported as an error.
type Status ¶
type Status struct {
// Version is the running build, with a leading "v" when it is a semver.
Version string `json:"version"`
// Latest is the newest release for this platform ("" when unknown).
Latest string `json:"latest,omitempty"`
// UpdateAvailable is true when Latest is newer than Version.
UpdateAvailable bool `json:"update_available"`
// UpdateCommand is the CLI command that installs the update.
UpdateCommand string `json:"update_command,omitempty"`
// ReleaseURL links to the release notes of Latest.
ReleaseURL string `json:"release_url,omitempty"`
// Checkable is false for development builds without a semantic version,
// which cannot be compared against releases.
Checkable bool `json:"checkable"`
}
Status describes the running version and whether a newer release exists.
func CurrentStatus ¶
CurrentStatus returns the running version and, for released builds, whether a newer release is published. GitHub lookups are cached so callers can poll it.