selfupdate

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package selfupdate answers one question — is a newer release published? — with one GitHub API call a day, cached on disk. It never fails loudly: update notice is a courtesy, not a feature the tool depends on.

Index

Constants

This section is empty.

Variables

View Source
var APIBase = "https://api.github.com/repos/midagedev/gadak"

APIBase is the GitHub API origin + repo path for release lookups. Tests replace it with an httptest server URL.

Functions

func Newer

func Newer(current, latest string) bool

Newer reports whether latest > current, comparing dotted numeric parts. Pre-release/dev suffixes are not newer than anything.

Types

type Info

type Info struct {
	Latest    string `json:"latest"`     // tag without leading v, e.g. "0.3.1"
	URL       string `json:"url"`        // release html_url
	CheckedAt string `json:"checked_at"` // RFC3339 UTC
}

Info is the cached answer.

func Check

func Check(ctx context.Context, cacheDir, current string, enabled bool) (Info, bool)

Check returns the latest release info, from cache when fresh (<24h), else from GitHub. current=="0.0.0-dev" or cfg opt-out → ("", ok=false) without any network. Any error → ok=false, silently.

Jump to

Keyboard shortcuts

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