selfupdate

package
v0.12.3 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2021 License: BSD-2-Clause Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadLatestStableRelease

func DownloadLatestStableRelease(ctx context.Context, target, currentVersion string, printf func(string, ...interface{})) (version string, err error)

DownloadLatestStableRelease downloads the latest stable released version of restic and saves it to target. It returns the version string for the newest version. The function printf is used to print progress information.

func GPGVerify

func GPGVerify(data, sig []byte) (ok bool, err error)

GPGVerify checks the authenticity of data by verifying the signature sig, which must be ASCII armored (base64). When the signature matches, GPGVerify returns true and a nil error.

Types

type Asset

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

Asset is a file uploaded and attached to a release.

type Release

type Release struct {
	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 string `json:"-"` // set manually in the code
}

Release collects data about a single release on GitHub.

func GitHubLatestRelease

func GitHubLatestRelease(ctx context.Context, owner, repo string) (Release, error)

GitHubLatestRelease uses the GitHub API to get information about the latest release of a repository.

func (Release) String

func (r Release) String() string

Jump to

Keyboard shortcuts

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