update

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArchiveName

func ArchiveName(version string, goos string, goarch string) (string, error)

func ExtractBinary

func ExtractBinary(archive []byte, goos string) ([]byte, error)

func NormalizeVersion

func NormalizeVersion(version string) string

func ReplaceExecutable

func ReplaceExecutable(path string, binary []byte, mode os.FileMode) error

func SameVersion

func SameVersion(left string, right string) bool

func ValidateVersion

func ValidateVersion(version string) (string, error)

func VerifyAssetChecksum

func VerifyAssetChecksum(assetName string, payload []byte, checksums []byte) error

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (Client) ByTag

func (client Client) ByTag(ctx context.Context, version string) (Release, error)

func (Client) Download

func (client Client) Download(ctx context.Context, downloadURL string) ([]byte, error)

func (Client) Latest

func (client Client) Latest(ctx context.Context) (Release, error)

type Release

type Release struct {
	TagName string         `json:"tag_name"`
	HTMLURL string         `json:"html_url"`
	Assets  []ReleaseAsset `json:"assets"`
}

type ReleaseAsset

type ReleaseAsset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
}

func FindAsset

func FindAsset(release Release, goos string, goarch string) (ReleaseAsset, error)

func FindChecksumAsset

func FindChecksumAsset(release Release) (ReleaseAsset, error)

Jump to

Keyboard shortcuts

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