Documentation
¶
Overview ¶
Package selfupdate finds the latest custos release, tells how the running binary was installed, keeps the result of the last release check, and replaces a standalone binary with a checksum-verified release binary.
Index ¶
- func Asset() string
- func AssetBase(version string) string
- func Latest(ctx context.Context) (string, error)
- func Newer(current, latest string) bool
- func Replace(ctx context.Context, exe, version string) error
- func SaveCheck(dir string, c Check) error
- func Valid(v string) bool
- type Check
- type Install
- type Method
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssetBase ¶
AssetBase is where the assets of version are downloaded from: $CUSTOS_DOWNLOAD_URL (a mirror URL or a local directory), else the GitHub release.
func Latest ¶
Latest returns the version (without "v") of the latest release. It reads the redirect of the releases/latest page, which, unlike the GitHub API, has no anonymous rate limit.
func Newer ¶
Newer reports whether latest is a later release than current. Either one not being a release version means no.
Types ¶
type Install ¶
type Install struct {
Method Method
// Path is the binary itself, symlinks resolved.
Path string
// Root is the Composer project requiring custos, when known.
Root string
}
Install describes the running binary.