updater

package
v1.15.13 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// APITimeout is how long we wait for the GitHub API.
	APITimeout = 30 * time.Second

	// BaseURL is exported for tests.
	BaseURL = "https://api.github.com/repos/%s/%s/releases/latest"
)
View Source
var (
	// DownloadTimeout is the overall timeout for the download, including all retries.
	DownloadTimeout = time.Minute * 5
)
View Source
var UpdateMoveAfterQuit = true

UpdateMoveAfterQuit is exported for testing.

Functions

func IsUpdateable

func IsUpdateable(ctx context.Context) error

IsUpdateable returns an error if this binary is not updateable.

func Update

func Update(ctx context.Context, currentVersion semver.Version) error

Update will start the interactive update assistant.

Types

type Asset

type Asset struct {
	ID   int    `json:"id"`
	Name string `json:"name"`
	URL  string `json:"browser_download_url"`
}

Asset is a GitHub release asset.

type Release

type Release struct {
	ID          int            `json:"id"`
	Name        string         `json:"name"`
	TagName     string         `json:"tag_name"`
	Draft       bool           `json:"draft"`
	Prerelease  bool           `json:"prerelease"`
	PublishedAt time.Time      `json:"published_at"`
	Assets      []Asset        `json:"assets"`
	Version     semver.Version `json:"-"`
}

Release is a GitHub release.

func FetchLatestRelease

func FetchLatestRelease(ctx context.Context) (Release, error)

FetchLatestRelease fetches meta-data about the latest Gopass release from GitHub.

Jump to

Keyboard shortcuts

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