fetch

package module
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 14 Imported by: 16

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FileNotFoundError = errors.New("file not found")

FileNotFoundError is an error type used to signal 404 HTTP status code responses.

Functions

This section is empty.

Types

type ArchiveFetcher

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

ArchiveFetcher holds the HTTP client that reties with back off when the file server is offline.

func NewArchiveFetcher

func NewArchiveFetcher(retries, maxDownloadSize, maxUntarSize int, hostnameOverwrite string) *ArchiveFetcher

NewArchiveFetcher configures the retryable http client used for fetching archives.

func (*ArchiveFetcher) Fetch

func (r *ArchiveFetcher) Fetch(archiveURL, digest, dir string) error

Fetch downloads, verifies and extracts the tarball content to the specified directory. If the file server responds with 5xx errors, the download operation is retried. If the file server responds with 404, the returned error is of type FileNotFoundError. If the file server is unavailable for more than 3 minutes, the returned error contains the original status code.

Jump to

Keyboard shortcuts

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