update

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckForUpdate

func CheckForUpdate(currentVersion, configDir string) string

CheckForUpdate queries GitHub for the latest release, using a 24h cache. Returns the latest version string (e.g. "v0.2.0") or "" if current is up to date.

func SelfUpdate

func SelfUpdate(currentVersion string) error

SelfUpdate downloads and replaces the current binary with the latest release.

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	Size               int64  `json:"size"`
}

Asset represents a release asset (binary archive).

type Release

type Release struct {
	TagName string  `json:"tag_name"`
	Assets  []Asset `json:"assets"`
	HTMLURL string  `json:"html_url"`
}

Release represents a GitHub release.

func GetLatestRelease

func GetLatestRelease() (*Release, error)

GetLatestRelease fetches the latest release info from GitHub.

type VersionCache

type VersionCache struct {
	LastCheck     time.Time `json:"last_check"`
	LatestVersion string    `json:"latest_version"`
	ReleaseURL    string    `json:"release_url"`
}

VersionCache stores the last check result.

Jump to

Keyboard shortcuts

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