download

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Download

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

Download can issue GET requests to download assets from a remote endpoint.

func New

func New(localDir string, timeout time.Duration, logger *log.Logger) *Download

New returns a new instance of Download.

func (*Download) Get

func (d *Download) Get(force bool, remoteURI, remoteURISHA string) (io.ReadCloser, error)

Get issues a GET request to the remote endpoint to download the promdump TAR file, to the localDir directory. If non-empty, it also fetches the SHA256 sum file from the specifed endpoint, and used that to verified the content of the downloaded TAR file. If the file is already present on the local file system, then the download will be skipped, unless force is set to true to trigger a re-download. The content of the file is then read and returned. Caller is responsible for closing the returned ReadCloser.

Jump to

Keyboard shortcuts

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