update

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2026 License: Apache-2.0 Imports: 19 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

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

type Result

type Result struct {
	CurrentVersion  string
	LatestVersion   string
	UpdateAvailable bool
	Updated         bool
}

Result describes the release selected by the update check.

func Run

func Run(ctx context.Context, options Options) (Result, error)

Run checks the latest GitHub release and optionally installs it. A release is installed only after the outer checksum, inner bundle checksums, manifest and executable version all agree.

Jump to

Keyboard shortcuts

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