updatecheck

package
v1.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 12 Imported by: 0

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

View Source
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

func DetectLatest(ctx context.Context) (*Result, error)

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

func DetectVersion(ctx context.Context, requested string) (*Result, error)

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

func CurrentStatus(ctx context.Context) Status

CurrentStatus returns the running version and, for released builds, whether a newer release is published. GitHub lookups are cached so callers can poll it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL