Documentation
¶
Overview ¶
Package selfupdate replaces the running fullsend CLI binary with a release from GitHub Releases. It installs a release only when the Sigstore signature on its checksums.txt verifies for that tag and the archive matches its recorded SHA256.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrDevBuild = errors.New("this fullsend binary is a development build; self-update only replaces release binaries")
ErrDevBuild is returned when the running binary is not a release build, so there is no release version to compare against.
Functions ¶
This section is empty.
Types ¶
type Options ¶
type Options struct {
// CurrentVersion is the version of the running binary.
CurrentVersion string
// TargetVersion is the release to install, such as "v0.53.0". Empty
// means the latest release. An explicit version may be older than the
// current one, which allows rolling back.
TargetVersion string
// DryRun reports what would change without installing anything. With
// TargetVersion set, it checks that the release has a build for this
// platform.
DryRun bool
}
Options configures a Run.
type Result ¶
type Result struct {
Status Status
// From and To are release tags, for example "v0.52.0".
From, To string
// Path is the resolved path of the binary.
Path string
}
Result describes the outcome of a Run.
type Status ¶
type Status int
Status says what Run did.
const ( // StatusUpToDate means the binary already runs the target release. StatusUpToDate Status = iota // StatusAhead means the binary is newer than the latest release (for // example a release candidate) and no version was requested. StatusAhead // StatusWouldUpdate means a dry run found an update to install. StatusWouldUpdate // StatusUpdated means the binary was replaced. StatusUpdated )
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater replaces the running binary. Build one with New; the function fields are test seams for this package.
Click to show internal directories.
Click to hide internal directories.