updater

package
v1.12.9 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2021 License: MIT Imports: 27 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 (
	// UpdateMoveAfterQuit is exported for testing
	UpdateMoveAfterQuit = true
)

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 th 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