fetch

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: MIT Imports: 19 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(ctx context.Context, a Asset) (string, error)

Path of the verified asset in the cache, downloading it on first use

func Root

func Root() string

Directory under the icebath data root where fetched assets live

func Tree

func Tree(ctx context.Context, a Asset) (string, error)

Directory holding the unpacked contents of a verified archive, unpacking it on first use

Types

type Asset

type Asset struct {
	Name   string
	URL    string
	SHA256 string
	Size   int64
}

One downloadable file pinned by size and sha256

type DigestError

type DigestError struct {
	Name, Want, Got string
}

Returned when downloaded bytes do not hash to the pinned digest

func (*DigestError) Error

func (e *DigestError) Error() string

type StatusError

type StatusError struct {
	Name string
	Code int
}

Returned when the server answers a download with a failing status

func (*StatusError) Error

func (e *StatusError) Error() string

Jump to

Keyboard shortcuts

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