Documentation
¶
Overview ¶
Package update self-updates the CLI binary from its GitHub releases. It is the fleet-standard self-updater: fetch the latest release, verify the archive against checksums.txt (mandatory), then atomically replace the running binary.
PER-CLI: set githubRepo + binaryName below. Nothing else changes — findAssets is robust to the fleet's two archive-naming styles (with/without version, amd64/x86_64).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
Prerelease bool `json:"prerelease"`
Assets []Asset `json:"assets"`
}
Release / Asset mirror the subset of the GitHub releases API we use.
type Updater ¶
type Updater struct {
CurrentVersion string
HTTPClient *http.Client
ExecutablePath string // overridable for tests
}
Updater checks for and applies updates.
func NewUpdater ¶
func (*Updater) CheckAndUpdate ¶
CheckAndUpdate updates to the latest release if it is newer than the running version.
Click to show internal directories.
Click to hide internal directories.