updater

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev"

Version is the current build version, set at build time via ldflags.

Functions

func DownloadDesktopUpdate

func DownloadDesktopUpdate(release *Release) (string, error)

DownloadDesktopUpdate downloads and extracts the .app.tar.gz for desktop mode. Returns the path to the extracted .app bundle.

func DownloadUpdate

func DownloadUpdate(release *Release) (string, error)

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

func SelfUpdate(newBinaryPath string) error

SelfUpdate replaces the current binary with the downloaded update.

func SelfUpdateDesktop

func SelfUpdateDesktop(newAppPath string) error

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

func CheckUpdate() (*Release, bool, error)

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.

Jump to

Keyboard shortcuts

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