manifest

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func VerifyHash

func VerifyHash(filePath string, expectedHash string) error

VerifyHash verifies that a file's SHA256 hash matches the expected value

Types

type HashVerifyReader

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

HashVerifyReader wraps a reader and computes SHA256 while reading

func VerifyHashReader

func VerifyHashReader(r io.Reader, expectedHash string) *HashVerifyReader

VerifyHashReader verifies SHA256 hash while reading, returns a reader that checks on close

func (*HashVerifyReader) Read

func (h *HashVerifyReader) Read(p []byte) (n int, err error)

func (*HashVerifyReader) Verify

func (h *HashVerifyReader) Verify() error

Verify checks if the hash matches after reading is complete

type Manifest

type Manifest struct {
	URL   string            // Base URL where manifest was fetched from
	Files map[string]string // filename -> SHA256 hash
}

Manifest represents a parsed SHA256SUMS manifest

func Fetch

func Fetch(ctx context.Context, httpClient *http.Client, baseURL string, verify bool) (*Manifest, error)

Fetch downloads and parses a SHA256SUMS manifest from the given base URL. If httpClient is nil, a default client with a 30-second timeout is used. If verify is true, it will also verify the GPG signature.

Jump to

Keyboard shortcuts

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