version

package
v0.0.0-...-cdad33c Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	AppVersion = devBuild         // In release builds this will be overwritten via ldflags
	GitCommit  = "unknown-commit" // -"-
)

Functions

func CheckVersion

func CheckVersion(ctx context.Context, stderrLogger *zerolog.Logger)

func DetectLatest

func DetectLatest(ctx context.Context, prerelease bool) (string, error)

DetectLatest returns the latest available version. When prerelease is true it returns the latest dev/prerelease version (from the Atom feed); otherwise it returns the latest GA release (from the /releases/latest redirect). Neither path touches the throttled api.github.com endpoint.

func DownloadAndApply

func DownloadAndApply(ctx context.Context, tag, exePath string) error

DownloadAndApply downloads the release archive for the given version from the GitHub CDN (not the throttled api.github.com), extracts the 'metaplay' binary, and atomically replaces the executable at exePath.

It reuses go-selfupdate's standalone helpers for the archive handling and the safe, cross-platform binary swap, so we don't have to reimplement either.

The archive is tens of MB, so this deliberately does NOT impose a hard timeout (a slow connection should not fail a legitimate update). Cancellation is governed by ctx, so the caller can bound or interrupt it (e.g. Ctrl+C via the command context).

func IsDevBuild

func IsDevBuild() bool

func IsNewer

func IsNewer(candidate, current string) bool

IsNewer reports whether candidate is a strictly newer version than current. Both are plain version strings (no leading 'v'). On parse failure it returns false, so a malformed version is never treated as an available update.

func IsPrerelease

func IsPrerelease() bool

IsPrerelease returns true if the current version is a prerelease build (e.g. "0.1.3-dev.5"), but not a local development build ("dev").

Types

This section is empty.

Jump to

Keyboard shortcuts

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