binaryupdate

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(exePath string, bin []byte) error

func CanWriteDir

func CanWriteDir(path string) bool

func ExtractSubtaskBinary

func ExtractSubtaskBinary(goos string, archiveName string, archiveData []byte) ([]byte, error)

func FindSHA256ForFilename

func FindSHA256ForFilename(checksums []byte, filename string) (string, bool)

func SHA256Hex

func SHA256Hex(b []byte) string

func SelectReleaseAssets

func SelectReleaseAssets(rel Release, goos, goarch string) (archive Asset, checksums Asset, err error)

func Stage

func Stage(exePath string, bin []byte) error

func StagedPath

func StagedPath(exePath string) string

func TryApplyStaged

func TryApplyStaged(exePath string) (bool, error)

func VerifySHA256

func VerifySHA256(checksums []byte, filename string, data []byte) error

Types

type Asset

type Asset struct {
	Name               string `json:"name"`
	BrowserDownloadURL string `json:"browser_download_url"`
	Size               int64  `json:"size"`
}

type Client

type Client struct {
	HTTP       *http.Client
	APIBaseURL string // e.g. https://api.github.com
	Repo       string // owner/name
}

func NewClient

func NewClient(httpClient *http.Client) *Client

func (*Client) Download

func (c *Client) Download(ctx context.Context, url string) ([]byte, error)

func (*Client) LatestRelease

func (c *Client) LatestRelease(ctx context.Context) (Release, error)

func (*Client) ReleaseByTag

func (c *Client) ReleaseByTag(ctx context.Context, tag string) (Release, error)

type Release

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

Jump to

Keyboard shortcuts

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