updater

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package updater checks for signed Growse release artifacts and installs a verified executable update for the current platform.

Index

Constants

This section is empty.

Variables

View Source
var CurrentVersion = "dev"

CurrentVersion is replaced with a release tag by scripts/package-gui.sh. Development builds intentionally never offer an update.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager checks and installs Growse releases.

func New

func New() *Manager

New returns a production updater. An unavailable executable path disables it safely by making Check return no update.

func NewWithOptions

func NewWithOptions(options Options) *Manager

NewWithOptions returns an updater configured for tests or production.

func (*Manager) Apply

func (manager *Manager) Apply(ctx context.Context, release Release) error

Apply downloads, verifies, stages, and restarts into release.

func (*Manager) Check

func (manager *Manager) Check(ctx context.Context) (Release, bool, error)

Check reports a newer stable release. Development builds and unsupported platforms do not contact GitHub.

type Options

type Options struct {
	CurrentVersion string
	APIURL         string
	ReleaseBaseURL string
	HTTPClient     *http.Client
	ExecutablePath string
	GOOS           string
	GOARCH         string
	PID            int
	Restart        func(executablePath, stagedPath string) error
}

Options provides test seams while production callers use New.

type Release

type Release struct {
	Version string
}

Release describes a newer release offered to the UI.

Jump to

Keyboard shortcuts

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