verifiers

package
v0.0.0-...-5f25c38 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HashAlgorithm

type HashAlgorithm string
const (
	MD5     HashAlgorithm = "md5"
	SHA1    HashAlgorithm = "sha1"
	SHA256  HashAlgorithm = "sha256"
	SHA512  HashAlgorithm = "sha512"
	Unknown HashAlgorithm = "unknown"
)

func DetermineHashTypeByLength

func DetermineHashTypeByLength(hash string) HashAlgorithm

type NoVerifier

type NoVerifier struct {
	Asset *assets.Asset
	Verifier
}

func (NoVerifier) GetAsset

func (n NoVerifier) GetAsset() *assets.Asset

func (NoVerifier) String

func (n NoVerifier) String() string

func (NoVerifier) Verify

func (n NoVerifier) Verify(_ []byte) error

func (NoVerifier) WithClient

func (n NoVerifier) WithClient(_ download.ClientContract) Verifier

type Sha256AssetVerifier

type Sha256AssetVerifier struct {
	AssetURL string
	Asset    *assets.Asset
	Verifier
	// contains filtered or unexported fields
}

func (*Sha256AssetVerifier) GetAsset

func (s256 *Sha256AssetVerifier) GetAsset() *assets.Asset

func (*Sha256AssetVerifier) String

func (s256 *Sha256AssetVerifier) String() string

func (*Sha256AssetVerifier) Verify

func (s256 *Sha256AssetVerifier) Verify(b []byte) error

func (*Sha256AssetVerifier) WithClient

func (s256 *Sha256AssetVerifier) WithClient(client download.ClientContract) Verifier

type Sha256Error

type Sha256Error struct {
	Expected []byte
	Got      []byte
}

func (*Sha256Error) Error

func (e *Sha256Error) Error() string

type Sha256Printer

type Sha256Printer struct {
	Asset *assets.Asset
	types.Type
}

func (Sha256Printer) GetAsset

func (s256 Sha256Printer) GetAsset() *assets.Asset

func (Sha256Printer) String

func (s256 Sha256Printer) String() string

func (Sha256Printer) Verify

func (s256 Sha256Printer) Verify(b []byte) error

func (Sha256Printer) WithClient

func (s256 Sha256Printer) WithClient(_ download.ClientContract) Verifier

type Sha256SumFileAssetVerifier

type Sha256SumFileAssetVerifier struct {
	Client            download.ClientContract
	Sha256SumAssetURL string
	RealAssetURL      string
	BinaryName        string
	Asset             *assets.Asset
	Verifier
}

func (*Sha256SumFileAssetVerifier) GetAsset

func (s256 *Sha256SumFileAssetVerifier) GetAsset() *assets.Asset

func (*Sha256SumFileAssetVerifier) String

func (s256 *Sha256SumFileAssetVerifier) String() string

func (*Sha256SumFileAssetVerifier) Verify

func (s256 *Sha256SumFileAssetVerifier) Verify(b []byte) error

func (*Sha256SumFileAssetVerifier) WithClient

type Sha256Verifier

type Sha256Verifier struct {
	Expected []byte

	Asset *assets.Asset
	Verifier
	// contains filtered or unexported fields
}

func NewSha256Verifier

func NewSha256Verifier(client download.ClientContract, expectedHex string) (*Sha256Verifier, error)

func (*Sha256Verifier) GetAsset

func (s256 *Sha256Verifier) GetAsset() *assets.Asset

func (*Sha256Verifier) String

func (s256 *Sha256Verifier) String() string

func (*Sha256Verifier) Verify

func (s256 *Sha256Verifier) Verify(b []byte) error

func (*Sha256Verifier) WithClient

func (s256 *Sha256Verifier) WithClient(client download.ClientContract) Verifier

type Verifier

type Verifier interface {
	Verify(b []byte) error
	WithClient(client download.ClientContract) Verifier
	GetAsset() *assets.Asset
	String() string
	types.Type
}

type VerifyChecksumResult

type VerifyChecksumResult byte
const (
	VerifyChecksumNone               VerifyChecksumResult = iota
	VerifyChecksumSuccess            VerifyChecksumResult = iota
	VerifyChecksumVerificationFailed VerifyChecksumResult = iota
	VerifyChecksumFailedNoVerifier   VerifyChecksumResult = iota
)

Jump to

Keyboard shortcuts

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