Documentation
¶
Overview ¶
Package version provides version information and update checking.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "v0.36.1" Commit = "none" Date = "unknown" )
Build info set via ldflags during build.
Functions ¶
func IsNewerRelease ¶
IsNewerRelease reports whether otherVersion is newer than current version.
Types ¶
type Info ¶
type Info struct {
Version string `json:"version"`
Commit string `json:"commit"`
Date string `json:"date"`
GoVersion string `json:"goVersion"`
}
Info holds current version information.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager handles version checking with caching.
func (*Manager) CheckUpdate ¶
func (m *Manager) CheckUpdate() (*UpdateInfo, error)
CheckUpdate checks for available updates from GitHub releases.
func (*Manager) ClearCache ¶
func (m *Manager) ClearCache()
ClearCache invalidates the cached version info.
func (*Manager) GetResponse ¶
GetResponse returns combined version and update info.
func (*Manager) GetResponseFallback ¶
GetResponseFallback returns basic version info without update check.
type UpdateInfo ¶
type UpdateInfo struct {
LatestVersion string `json:"latestVersion"`
UpdateAvailable bool `json:"updateAvailable"`
ReleaseURL string `json:"releaseUrl"`
PublishedAt time.Time `json:"publishedAt,omitempty"`
ReleaseNotes string `json:"releaseNotes,omitempty"`
InstallCommand string `json:"installCommand,omitempty"`
}
UpdateInfo holds information about available updates.
Click to show internal directories.
Click to hide internal directories.