update

package
v0.0.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 6 Imported by: 0

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 NewUpdater

func NewUpdater() *Updater

NewUpdater creates a new Updater instance.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL