Documentation
¶
Index ¶
- Variables
- func Compare[T artifact.Artifact, U Checksums[T]](ctx context.Context, localArtifact artifact.Local[T], ...) error
- func Compute[T artifact.Artifact](ctx context.Context, h hash.Hash, d artifact.Local[T]) (string, error)
- func Extract[T artifact.Artifact, U Checksums[T]](ctx context.Context, local artifact.Local[U], a T) (string, error)
- type Checksums
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrChecksumMismatch = errors.New("checksum does not match") ErrChecksumsUnsupported = errors.New("version precedes checksums") )
Functions ¶
func Compare ¶
func Compare[T artifact.Artifact, U Checksums[T]]( ctx context.Context, localArtifact artifact.Local[T], localChecksums artifact.Local[U], ) error
Compare takes a local executable archive and a local checksums file for executable archives and validates that the executable archive's checksum matches the expected value.
Types ¶
type Checksums ¶
type Checksums[T artifact.Artifact] interface { artifact.Artifact // Supports is a method to register which artifact the checksums are for. Supports(_ T) // Hash returns a 'hash.Hash' instance used to compute the checksum of the // supported artifact type. Hash() hash.Hash }
An interface for an 'Artifact' representing a checksums file.
Click to show internal directories.
Click to hide internal directories.