checksum

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidChecksumFile = errors.New("invalid checksum file")
View Source
var ErrNoCheckSumAsset = errors.New("no checksum asset found")

Functions

This section is empty.

Types

type CheckSumValidator

type CheckSumValidator interface {
	IsCheckSumValid(ctx context.Context, binary string, checksums *Info, downloadedChecksum string) bool
}

func NewCheckSumValidator

func NewCheckSumValidator(opts ...ValidatorOption) CheckSumValidator

type DownloadOpt

type DownloadOpt func(*checksumDownloader)

func WithAssetSuffix

func WithAssetSuffix(suffix string) DownloadOpt

type Downloader

type Downloader interface {
	Download(ctx context.Context, assets []release.Asset) (*Info, error)
}

func NewCheckSumDownloader

func NewCheckSumDownloader(opts ...DownloadOpt) Downloader

type Info

type Info struct {
	// keyed on $binary_os_$arch
	Checksums map[string]string
}

type ValidatorOption

type ValidatorOption func(*validator)

func WithArch

func WithArch(a string) ValidatorOption

func WithOS

func WithOS(os string) ValidatorOption

Jump to

Keyboard shortcuts

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