Documentation ¶
Overview ¶
Package selfupdate implements a cryptographically secured self-update mechanism which fetches binaries via GitHub's API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadAndVerifyRelease ¶
func DownloadAndVerifyRelease(ctx context.Context, rel *Release, target string, logger *log.Logger) error
DownloadAndVerifyRelease downloads a released version of cunīcu 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 ¶
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.
func VersionVerify ¶
Types ¶
type Release ¶
type Release struct { Name string `json:"name"` TagName string `json:"tag_name"` Draft bool `json:"draft"` PreRelease bool `json:"prerelease"` //nolint:tagliatelle 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 ¶
GitHubLatestRelease uses the GitHub API to get information about the latest release of a repository.