updater

package
v0.36.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupOldBinary added in v0.34.0

func CleanupOldBinary() error

CleanupOldBinary removes a leftover .old binary from a previous Windows update. Safe to call on any platform — returns nil if no .old file exists.

Types

type UpdateInfo

type UpdateInfo struct {
	CurrentVersion  string `json:"current_version"`
	LatestVersion   string `json:"latest_version"`
	UpdateAvailable bool   `json:"update_available"`
	ReleaseURL      string `json:"release_url"`
	AssetURL        string `json:"-"`
	ChecksumsURL    string `json:"-"`
}

UpdateInfo holds the result of a version check against GitHub Releases.

func CheckForUpdate

func CheckForUpdate(ctx context.Context, currentVersion string) (*UpdateInfo, error)

CheckForUpdate checks the GitHub Releases API for a newer version. No authentication is required for public repositories.

type UpdateResult

type UpdateResult struct {
	PreviousVersion string `json:"previous_version"`
	NewVersion      string `json:"new_version"`
	BinaryPath      string `json:"binary_path"`
}

UpdateResult holds the result of a completed update.

func PerformUpdate

func PerformUpdate(ctx context.Context, info *UpdateInfo) (*UpdateResult, error)

PerformUpdate downloads and installs the update described by info. It downloads the archive, verifies its checksum, extracts the binary, and atomically replaces the current binary.

Jump to

Keyboard shortcuts

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