update

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDocker

func IsDocker() bool

IsDocker returns true if running inside a Docker container.

func LogIfUpdateAvailable

func LogIfUpdateAvailable(repo, currentVersion, binaryName string)

LogIfUpdateAvailable checks for updates and logs a warning if one is available.

func SelfUpdate

func SelfUpdate(downloadURL, checksumURL, binaryName string) error

SelfUpdate downloads the latest release, verifies its checksum, and replaces the current binary. binaryName is the base name used to look up the checksum (e.g. "gatecrash-server").

Types

type Asset

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

Asset represents a release asset.

type CheckResult

type CheckResult struct {
	CurrentVersion  string
	LatestVersion   string
	UpdateAvailable bool
	DownloadURL     string
	ChecksumURL     string
}

CheckResult contains the result of a version check.

func Check

func Check(repo, currentVersion, binaryName string) (*CheckResult, error)

Check queries GitHub for the latest release and compares with current version. binaryName is the base name of the binary (e.g. "gatecrash" or "gatecrash-server").

type GitHubRelease

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

GitHubRelease represents a GitHub release API response.

Jump to

Keyboard shortcuts

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