Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FindAsset ¶
FindAsset returns the download URL for the current OS/arch from the release assets.
func RecordUpdateCheck ¶ added in v1.10.0
func RecordUpdateCheck()
RecordUpdateCheck writes the current timestamp to the state file.
func ShouldCheckForUpdate ¶ added in v1.10.0
func ShouldCheckForUpdate() bool
ShouldCheckForUpdate returns true if the last update check was more than 24 hours ago (or if the state file doesn't exist).
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
}
Asset represents a downloadable file from a GitHub release.
type InstallMethod ¶
type InstallMethod int
InstallMethod describes how the binary was installed.
const ( MethodSourceBuild InstallMethod = iota MethodGoInstall MethodPrebuilt )
func DetectInstallMethod ¶
func DetectInstallMethod(version, commit string) InstallMethod
DetectInstallMethod determines how the binary was installed.
type Release ¶
Release represents the relevant fields from a GitHub release.
func CheckLatest ¶
CheckLatest fetches the latest release from GitHub and returns it.
type Version ¶
Version represents a parsed semantic version.
func ParseVersion ¶
ParseVersion parses a version string like "1.2.3", "v1.2.3", or "1.2.3-dev".
func (Version) Compare ¶
Compare returns -1, 0, or 1 comparing v to other. Pre-release versions are considered older than the same version without pre-release.
func (Version) IsNewerThan ¶
IsNewerThan returns true if v is strictly newer than other.