download

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func File

func File(file string, url string) error

File downloads a provided url to the file path specified.

func Get

func Get(url string) ([]byte, error)

Get downloads a url and returns the body Timeout is 10 seconds Will only write to disk if http status code is 2XX

func IfNeeded

func IfNeeded(absFile string, url string, hash string) bool

IfNeeded takes the same values as Download plus a hash as a string It will check if the file already exists, by comparing the hash If the hash does not match, it will attempt to download the file Once downloaded it will attempt to verify the hash again

func SetConfig

func SetConfig(cfg config.Configuration)

SetConfig accepts a configuration struct that all functions in the `download` package will use

func Verify

func Verify(file string, sha string) bool

Verify compares a provided hash to the actual hash of a file

Types

This section is empty.

Jump to

Keyboard shortcuts

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