updater

package
v2026.1009.2 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: MIT Imports: 24 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRestartScheduled = errors.New("restart scheduled after update")

Functions

func CommitInstall added in v2026.1009.0

func CommitInstall(staged, target string) error

CommitInstall replaces the binary atomically, restoring it on failure.

func DesktopAssetName added in v2026.1009.0

func DesktopAssetName(tag, goos, arch string) (string, error)

func DesktopExecutablePath added in v2026.1009.0

func DesktopExecutablePath(cli string) (string, error)

func EnsureDesktop added in v2026.1009.0

func EnsureDesktop(ctx context.Context, version, cli string, progress io.Writer) (string, error)

EnsureDesktop completes a CLI-only installation on its first normal launch. Subsequent launches use the recorded version without consulting the network.

func ExecInstallRestart added in v2026.609.2

func ExecInstallRestart(ctx context.Context, tag string) error

func ExecInstallRestartForTest added in v2026.701.3

func ExecInstallRestartForTest(ctx context.Context, tag string) error

func FinishUpgradeRestart added in v2026.701.0

func FinishUpgradeRestart(ctx context.Context, tag string) error

func Install

func Install(ctx context.Context, tag string, progress io.Writer) error

func InstallCommand added in v2026.603.0

func InstallCommand(tag string) (string, error)

func InstallDesktop added in v2026.1009.0

func InstallDesktop(ctx context.Context, tag, cli string, progress io.Writer) error

func InstallFallbackMessage added in v2026.621.0

func InstallFallbackMessage(tag string) string

func IsDevelopmentVersion added in v2026.924.0

func IsDevelopmentVersion(current string) bool

IsDevelopmentVersion reports whether current identifies a local/development build rather than a published release. The updater compares a development build's commit with the latest release before deciding whether it is stale.

func IsNewerRelease

func IsNewerRelease(latestTag, current string) bool

func PrepareInstall added in v2026.1009.0

func PrepareInstall(ctx context.Context, tag string, progress io.Writer) (staged, target string, err error)

PrepareInstall downloads and verifies a release beside its final destination. It does not replace the running installation; the caller owns the staged file.

func ReleaseAssetName

func ReleaseAssetName(tag string) (string, error)

func RunSystemInstall added in v2026.603.0

func RunSystemInstall(ctx context.Context, tag string, progress io.Writer) error

func SetCompareReleaseAPIURL added in v2026.924.0

func SetCompareReleaseAPIURL(url string) func()

func SetDesktopRegistrar added in v2026.1009.0

func SetDesktopRegistrar(fn func(context.Context, string, string, string, io.Writer) error) func()

SetDesktopRegistrar replaces OS registration for isolated installer tests.

func SetExecInstallRestartHook added in v2026.701.0

func SetExecInstallRestartHook(fn func(context.Context, string) error) func()

func SetHTTPDownload added in v2026.613.0

func SetHTTPDownload(fn func(context.Context, string) (*http.Response, error)) func()

func SetLatestReleaseAPIURL

func SetLatestReleaseAPIURL(url string) func()

func SetReleaseCommitAPIURL added in v2026.924.0

func SetReleaseCommitAPIURL(url string) func()

func SetScheduleInstallRestartHook added in v2026.605.0

func SetScheduleInstallRestartHook(fn func(context.Context, string, io.Writer) error) func()

func SimulateUpgradeExitRestartForTest added in v2026.701.0

func SimulateUpgradeExitRestartForTest(tag string) error

func SnapshotSourceTree added in v2026.1001.1

func SnapshotSourceTree(root string) (string, error)

SnapshotSourceTree records the source inputs before release binaries and their checksums are generated. A private index leaves the user's staging untouched; Git applies the same ignore rules and line-ending filters as a normal commit.

func UsesExecInstallRestartAfterSystemInstall added in v2026.701.0

func UsesExecInstallRestartAfterSystemInstall() bool

func UsesExecInstallRestartAfterSystemInstallForTest added in v2026.701.0

func UsesExecInstallRestartAfterSystemInstallForTest() bool

func WindowsInstallRestartScriptBodyForTest added in v2026.701.0

func WindowsInstallRestartScriptBodyForTest(pid int, tag, cwd, exe string, args []string) (string, error)

Types

type CheckResult

type CheckResult struct {
	Current              string
	LatestTag            string
	Newer                bool
	Err                  error
	LocalCommitRelation  string
	MatchesReleaseSource bool
}

func Check

func Check(ctx context.Context, currentVersion string) CheckResult

func CheckWithCommit added in v2026.924.0

func CheckWithCommit(ctx context.Context, currentVersion, localCommit string) CheckResult

func CheckWithCommitTime added in v2026.924.0

func CheckWithCommitTime(ctx context.Context, currentVersion, localCommit string, localCommitTime time.Time) CheckResult

func CheckWithSourceTree added in v2026.1001.1

func CheckWithSourceTree(ctx context.Context, currentVersion, localCommit string, localCommitTime time.Time, sourceTree string) CheckResult

CheckWithSourceTree compares the current source commit and the input tree captured before compiling assets, independently of the executable's bytes.

func (CheckResult) Notice

func (r CheckResult) Notice() *Notice

type Notice

type Notice struct {
	Current string
	Latest  string
}

Jump to

Keyboard shortcuts

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