updater

package
v0.0.0-...-ec117d0 Latest Latest
Warning

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

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

Documentation

Overview

Package updater checks for and installs updates from GitHub Releases. It is intentionally dependency-free (standard library only) so it can be imported by both the TUI and the CLI without pulling in TUI dependencies.

Index

Constants

This section is empty.

Variables

View Source
var SigningPublicKey string

SigningPublicKey is the Ed25519 public key used to verify release signatures. Set at build time via -ldflags for release builds. Empty means "no signing key configured" — verification is skipped with a warning. The value should be hex-encoded (64 chars = 32 bytes).

Functions

func Update

func Update(currentVersion string, progress func(string)) error

Update downloads and installs the latest release binary for the current platform. progress is called with human-readable status messages as the update proceeds. Returns nil on success; the caller should prompt the user to restart syllago.

Types

type ReleaseInfo

type ReleaseInfo struct {
	Version      string // e.g. "0.5.0" (no "v" prefix)
	TagName      string // e.g. "v0.5.0"
	Body         string // release notes markdown
	UpdateAvail  bool   // true if Version is newer than the version passed to CheckLatest
	AssetURL     string // direct download URL for the correct platform binary
	ChecksumURL  string // direct download URL for checksums.txt
	SignatureURL string // direct download URL for checksums.txt.sig (Ed25519)
}

ReleaseInfo holds information about the latest GitHub release.

func CheckLatest

func CheckLatest(currentVersion string) (ReleaseInfo, error)

CheckLatest fetches the latest release from GitHub and compares it to currentVersion (which should be without the "v" prefix, e.g. "0.4.0").

Jump to

Keyboard shortcuts

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