Documentation
¶
Overview ¶
Package updater checks GitHub releases and replaces the running binary. It owns the release asset naming (see scripts/build) and never touches processes or databases: callers stop and start the server around Swap.
Index ¶
- Constants
- Variables
- func AssetName(goos, goarch string) string
- func Compare(current, latest version.Version) int
- func Discard(staging string)
- func ExtractBinary(archive []byte, binaryName string) ([]byte, error)
- func Stage(executable string, binary []byte) (string, error)
- func Swap(executable, staging string) (string, error)
- func VerifyChecksum(checksums []byte, assetName string, data []byte) error
- type Client
- type Release
Constants ¶
View Source
const ( // Repository is the GitHub repository that publishes releases. Repository = "TheSlopMachine/llm-router" // DefaultAPIBase is the GitHub REST API root. DefaultAPIBase = "https://api.github.com" // ChecksumsAssetName is the checksum list published with each release. ChecksumsAssetName = "checksums.txt" MaxArchiveBytes int64 = 256 << 20 MaxChecksumBytes int64 = 1 << 20 )
Variables ¶
View Source
var ErrNoRelease = errors.New("no release published")
ErrNoRelease reports a repository without a published release.
Functions ¶
func Compare ¶
Compare orders two versions: negative when current is older than latest, zero when equal, positive when newer.
func ExtractBinary ¶
ExtractBinary returns the named executable from a release archive.
func Stage ¶
Stage writes the new binary next to executable and returns its path. Callers run it once to confirm it works before Swap.
Types ¶
Click to show internal directories.
Click to hide internal directories.