updater

package
v0.32.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package updater provides a lightweight, cached version check against GitHub Releases. It is designed to be non-blocking: fire it in a goroutine at startup and only print a notice when the command finishes, if a newer version was found.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChecksumURL

func ChecksumURL(tag string) string

ChecksumURL returns the checksums.txt URL for a given release tag.

func DownloadURL

func DownloadURL(tag string) string

DownloadURL returns the tarball URL for a given release tag on this platform.

func SelfUpgrade

func SelfUpgrade(tag string, progress io.Writer) error

SelfUpgrade downloads the given release tag, verifies the SHA-256 checksum, then atomically replaces the currently running binary. Progress is reported via the provided writer (use os.Stderr for terminal output).

Types

type CheckResult

type CheckResult struct {
	Current         string
	Latest          string
	ReleaseURL      string
	UpdateAvailable bool
}

CheckResult holds the outcome of a version comparison.

func Check

func Check(current string) (*CheckResult, error)

Check compares the running version against the latest GitHub Release. It caches the result for 24h to avoid rate-limiting. Safe to call concurrently.

func CheckForUpgrade

func CheckForUpgrade(current string) (*CheckResult, error)

CheckForUpgrade always fetches the latest release from GitHub, bypassing both the 24h cache and the dev-build guard. Used by 'devx upgrade' so that the command always has fresh data and works during development.

Jump to

Keyboard shortcuts

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