selfupdate

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2026 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package selfupdate installs a verified Multiversa CLI release over the executable that invoked the operation. It never escalates privileges.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssetName

func AssetName(versionTag, goos, goarch string) string

AssetName renders the exact archive name emitted by GoReleaser.

Types

type Options

type Options struct {
	Version        string
	Target         string
	GOOS           string
	GOARCH         string
	ReleaseBaseURL string
	Client         *http.Client
}

Options identifies the release and executable to replace. Target, platform, client and base URL are injectable so the updater is testable without changing the process that runs the test.

type Result

type Result struct {
	Version    string `json:"version"`
	Path       string `json:"path"`
	BackupPath string `json:"backup_path"`
	Checksum   string `json:"checksum"`
	Pending    bool   `json:"pending,omitempty"`
	StatusPath string `json:"status_path,omitempty"`
}

Result is evidence that the verified release replaced the intended binary.

func Apply

func Apply(ctx context.Context, opts Options) (Result, error)

Apply downloads, verifies and atomically replaces the current executable. The previous bytes remain beside it as .rollback for an explicit rollback.

Jump to

Keyboard shortcuts

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