upgrade

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2024 License: MIT Imports: 9 Imported by: 1

README

Upgrade

Upgrade makes it easy to add an upgrade command to your cli.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCheckSum = errors.New("invalid checksum")

Functions

This section is empty.

Types

type Opt

type Opt func(*upgrader)

func WithAssetDownloader

func WithAssetDownloader(d asset.Downloader) Opt

func WithCheckSumDownloader

func WithCheckSumDownloader(c checksum.Downloader) Opt

func WithCheckSumValidator

func WithCheckSumValidator(c checksum.CheckSumValidator) Opt

type Upgrader

type Upgrader interface {
	IsNewVersionAvailable(ctx context.Context, currentVersion string) (bool, error)
	// Upgrade upgrades the current binary to the latest version.
	Upgrade(ctx context.Context, currentVersion string) error
}

func NewUpgrader

func NewUpgrader(owner string, repo string, executablePath string, opts ...Opt) Upgrader

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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