checksum

package
v2.20.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2023 License: MIT Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoChecksumExtracted = errors.New("no checksum is extracted")
	ErrNoChecksumIsFound   = errors.New("no checksum is found")
)

Functions

func CalculateReader

func CalculateReader(file io.Reader, algorithm string) (string, error)

func CheckRegistry

func CheckRegistry(regist *aqua.Registry, checksums *Checksums, content []byte) error

func GetChecksum added in v2.7.0

func GetChecksum(logE *logrus.Entry, assetName, checksumFileContent string, checksumConfig *registry.Checksum) (string, error)

func GetChecksumConfigFromFilename

func GetChecksumConfigFromFilename(filename, version string) *registry.Checksum

func GetChecksumFilePathFromConfigFilePath

func GetChecksumFilePathFromConfigFilePath(fs afero.Fs, cfgFilePath string) (string, error)

func GetRuntimesFromSupportedEnvs

func GetRuntimesFromSupportedEnvs(cfgSupportedEnvs, pkgSupportedEnvs []string) ([]*runtime.Runtime, error)

func ParseChecksumFile added in v2.7.0

func ParseChecksumFile(content string, checksumConfig *registry.Checksum) (map[string]string, string, error)

func RegistryID

func RegistryID(regist *aqua.Registry) string

Types

type Calculator

type Calculator struct{}

func NewCalculator

func NewCalculator() *Calculator

func (*Calculator) Calculate

func (*Calculator) Calculate(fs afero.Fs, filename, algorithm string) (string, error)

type Checksum

type Checksum struct {
	ID        string `json:"id"`
	Checksum  string `json:"checksum"`
	Algorithm string `json:"algorithm"`
}

type Checksums

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

func New

func New() *Checksums

func (*Checksums) EnableOutput added in v2.10.1

func (c *Checksums) EnableOutput()

func (*Checksums) Get

func (c *Checksums) Get(key string) *Checksum

func (*Checksums) Prune

func (c *Checksums) Prune()

func (*Checksums) ReadFile

func (c *Checksums) ReadFile(fs afero.Fs, p string) error

func (*Checksums) Set

func (c *Checksums) Set(key string, chk *Checksum)

func (*Checksums) UpdateFile

func (c *Checksums) UpdateFile(fs afero.Fs, p string) error

Jump to

Keyboard shortcuts

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