checksum

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrChecksumMismatch     = errors.New("checksum does not match")
	ErrChecksumsUnsupported = errors.New("version precedes checksums")
)
View Source
var (
	ErrChecksumNotFound    = errors.New("checksum not found")
	ErrConflictingChecksum = errors.New("conflicting checksum")
	ErrUnrecognizedFormat  = errors.New("unrecognized format")
)
View Source
var ErrUnsupportedArtifact = errors.New("unsupported artifact")

Functions

func Compare

func Compare[T archive.Archive, 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.

func Compute

func Compute[T archive.Archive](ctx context.Context, d artifact.Local[T]) (string, error)

Computes and returns the correct checksum of the specified archive.

func Extract

func Extract[T archive.Archive, U Checksums[T]](ctx context.Context, c artifact.Local[U], a T) (string, error)

Given a locally-available checksums file, find and return the checksum for the specified archive.

Types

type Checksums

type Checksums[T artifact.Artifact] interface {
	artifact.Artifact
	artifact.Versioned
	// contains filtered or unexported methods
}

An interface for an 'Artifact' representing a checksums file.

type Executable

type Executable checksums

An 'Artifact' representing a Godot source archive checksums file.

func NewExecutable

func NewExecutable(v version.Version) (Executable, error)

Returns a new 'Executable' struct after validating the Godot version.

func (Executable) Name

func (ex Executable) Name() string

func (Executable) Version

func (ex Executable) Version() version.Version

type Source

type Source checksums

An 'Artifact' representing a Godot source archive checksums file.

func NewSource

func NewSource(v version.Version) (Source, error)

Returns a new 'Source' struct after validating the Godot version.

func (Source) Name

func (s Source) Name() string

func (Source) Version

func (s Source) Version() version.Version

Jump to

Keyboard shortcuts

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