Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Version = "dev"
Version is the current build version, set at build time via ldflags.
Functions ¶
func DownloadDesktopUpdate ¶
DownloadDesktopUpdate downloads and extracts the .app.tar.gz for desktop mode. Returns the path to the extracted .app bundle.
func DownloadUpdate ¶
DownloadUpdate downloads the appropriate binary for the current platform.
func ExpectedDesktopAssetName ¶
func ExpectedDesktopAssetName() string
ExpectedDesktopAssetName returns the expected .app.tar.gz asset name for desktop updates.
func SelfUpdate ¶
SelfUpdate replaces the current binary with the downloaded update.
func SelfUpdateDesktop ¶
SelfUpdateDesktop replaces the current .app bundle with the new one.
Types ¶
type Asset ¶
type Asset struct {
Name string `json:"name"`
BrowserDownloadURL string `json:"browser_download_url"`
Size int64 `json:"size"`
}
Asset represents a release asset.
type Release ¶
type Release struct {
TagName string `json:"tag_name"`
Name string `json:"name"`
Assets []Asset `json:"assets"`
HTMLURL string `json:"html_url"`
}
Release represents a GitHub release.
func CheckUpdate ¶
CheckUpdate checks if a newer version is available on GitHub.
type UpdateStatus ¶
type UpdateStatus struct {
Available bool `json:"available"`
CurrentVersion string `json:"current_version"`
LatestVersion string `json:"latest_version"`
ReleaseURL string `json:"release_url"`
CheckedAt time.Time `json:"checked_at"`
Error string `json:"error,omitempty"`
// contains filtered or unexported fields
}
UpdateStatus represents the current update check state.
func NewUpdateStatus ¶
func NewUpdateStatus() *UpdateStatus
NewUpdateStatus creates a new UpdateStatus.
func (*UpdateStatus) Check ¶
func (s *UpdateStatus) Check()
Check performs a background update check and updates the status.
func (*UpdateStatus) Release ¶
func (s *UpdateStatus) Release() *Release
Release returns the cached release (may be nil).
func (*UpdateStatus) Snapshot ¶
func (s *UpdateStatus) Snapshot() UpdateStatus
Snapshot returns a copy safe for JSON serialization.