updater

package
v0.123.11 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAndUpdate

func CheckAndUpdate(ctx context.Context, o Options) error

CheckAndUpdate checks GitHub releases for a newer version and, if newer, downloads the corresponding tar.gz asset, extracts the binary, and atomically replaces CurrentPath. If the binary was installed via a package manager (brew, krew), it will display the appropriate upgrade command instead of performing the update.

Types

type Options

type Options struct {
	// Repo in owner/name form. Defaults to replicatedhq/troubleshoot
	Repo string
	// BinaryName expected executable name inside the archive (preflight or support-bundle)
	BinaryName string
	// CurrentPath path to the currently executing binary to be replaced
	CurrentPath string
	// Skip whether to skip update (effective no-op)
	Skip bool
	// HTTPClient optional custom client
	HTTPClient *http.Client
	// Printf allows caller to receive status messages (optional)
	Printf func(string, ...interface{})
}

Options control updater behavior.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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