update

package
v0.38.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedPlatform indicates the current OS/architecture is not supported.
	ErrUnsupportedPlatform = errors.New("unsupported platform")

	// ErrChecksumMismatch indicates the downloaded archive failed SHA256 verification.
	ErrChecksumMismatch = errors.New("checksum mismatch")

	// ErrBinaryNotFound indicates the binary was not found inside the archive.
	ErrBinaryNotFound = errors.New("binary not found in archive")
)

Sentinel errors for update operations.

Functions

This section is empty.

Types

type PlatformInfo

type PlatformInfo struct {
	OS         string // GoReleaser OS name (e.g., "Linux", "Darwin", "Windows")
	Arch       string // GoReleaser arch name (e.g., "x86_64", "arm64")
	ArchiveExt string // Archive extension (e.g., ".tar.gz", ".zip")
}

PlatformInfo describes the target platform for binary downloads.

func DetectPlatform

func DetectPlatform() (PlatformInfo, error)

DetectPlatform maps the current runtime OS and architecture to GoReleaser names.

type UpdateError

type UpdateError struct {
	Op  string // "download", "verify", "extract", "replace"
	Err error
}

UpdateError represents an error during the update process.

func (*UpdateError) Error

func (e *UpdateError) Error() string

func (*UpdateError) Unwrap

func (e *UpdateError) Unwrap() error

type Updater

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

Updater downloads and installs TAG binary updates from GitHub Releases.

func New

func New(repoURL string, out io.Writer) *Updater

New creates an Updater for the given GitHub repository URL.

func (*Updater) Update

func (u *Updater) Update(ctx context.Context, version, binaryPath string) error

Update downloads the specified version and replaces the binary at binaryPath.

Jump to

Keyboard shortcuts

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