Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version = "dev" Commit = "unknown" BuildDate = "unknown" )
Version information - injected at build time via ldflags: go build -ldflags "-X github.com/atterpac/tempo/internal/update.Version=1.2.3 -X github.com/atterpac/tempo/internal/update.Commit=abc123 -X github.com/atterpac/tempo/internal/update.BuildDate=2024-01-01"
Functions ¶
func GetCurrentVersion ¶
func GetCurrentVersion() string
GetCurrentVersion returns the current version string.
func GetVersionInfo ¶
func GetVersionInfo() string
GetVersionInfo returns formatted version information.
func IsHomebrewInstall ¶ added in v0.0.12
func IsHomebrewInstall() bool
IsHomebrewInstall returns true if the binary was installed via Homebrew.
Types ¶
type UpdateInfo ¶
type UpdateInfo struct {
CurrentVersion string
LatestVersion string
ReleaseURL string
ReleaseNotes string
NeedsUpdate bool
}
UpdateInfo contains information about an available update.
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater handles checking for and applying updates.
func (*Updater) ApplyUpdate ¶
func (u *Updater) ApplyUpdate(ctx context.Context, info *UpdateInfo) error
ApplyUpdate downloads and applies the update.
func (*Updater) CheckForUpdate ¶
func (u *Updater) CheckForUpdate(ctx context.Context) (*UpdateInfo, error)
CheckForUpdate checks if a newer version is available.
Click to show internal directories.
Click to hide internal directories.