update

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package update checks whether a newer netscope release is available on GitHub. It never downloads or installs anything — it reports status that the menu bar and dashboard surface, with a link to the release page. (Automatic self-update is deferred: it needs code signing and privileged replacement of the root daemon.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Newer

func Newer(latest, current string) bool

Newer reports whether version `latest` is strictly greater than `current` under semver (ignoring a leading "v" and any pre-release suffix). If either side is not parseable (e.g. a "dev" build), it returns false so we never nag.

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker periodically refreshes and caches an update Status.

func NewChecker

func NewChecker(repo, current string, interval time.Duration) *Checker

NewChecker builds a Checker. interval bounds how often GitHub is queried.

func (*Checker) Run

func (c *Checker) Run(ctx context.Context)

Run checks immediately, then on the interval, until ctx is cancelled.

func (*Checker) Status

func (c *Checker) Status() Status

Status returns the most recent cached status.

type Status

type Status struct {
	Current         string    `json:"current"`
	Latest          string    `json:"latest"`
	UpdateAvailable bool      `json:"updateAvailable"`
	URL             string    `json:"url"`      // release page (human-facing)
	AssetURL        string    `json:"assetUrl"` // app .zip download (in-app self-update)
	CheckedAt       time.Time `json:"checkedAt"`
}

Status is the cached result of an update check.

func Check

func Check(ctx context.Context, repo, current string) (Status, error)

Check queries the repo's latest GitHub release and compares it to current. A repo with no releases yields a non-error Status with UpdateAvailable=false.

Jump to

Keyboard shortcuts

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