Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatSize ¶
FormatSize formats bytes as a human-readable string.
func IsDevBuildVersion ¶
IsDevBuildVersion returns true if the version is a dev build.
func PerformUpdate ¶
func PerformUpdate( info *UpdateInfo, progressFn func(downloaded, total int64), ) error
PerformUpdate downloads and installs the update.
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
Size int64 `json:"size"`
BrowserDownloadURL string `json:"browser_download_url"`
}
Asset represents a release asset.
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
Body string `json:"body"`
Assets []Asset `json:"assets"`
}
Release represents a GitHub release.
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string
LatestVersion string
DownloadURL string
AssetName string
Size int64
Checksum string
IsDevBuild bool
// contains filtered or unexported fields
}
UpdateInfo contains information about an available update.
func CheckForUpdate ¶
func CheckForUpdate( currentVersion string, forceCheck bool, cacheDir string, ) (*UpdateInfo, error)
CheckForUpdate checks if a newer version is available. Uses a 1-hour cache to avoid hitting the GitHub API often.
func (*UpdateInfo) NeedsRefetch ¶ added in v0.2.0
func (u *UpdateInfo) NeedsRefetch() bool
NeedsRefetch returns true when the info came from cache and lacks the download URL/checksum needed for an install.
Click to show internal directories.
Click to hide internal directories.