Documentation
¶
Overview ¶
Package httputil offers functions to read and download files via HTTP.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultTransport specifies the http.RoundTripper that is used for any network traffic, and may be replaced with a dummy implementation for unit testing. DefaultTransport = http.DefaultTransport )
Functions ¶
func DownloadBinary ¶
DownloadBinary downloads a file from the given URL into the specified location, marks it executable and returns its full path.
func MaybeDownload ¶
func MaybeDownload(bazeliskHome, url, filename, description, token string, merger ContentMerger) ([]byte, error)
MaybeDownload downloads a file from the given url and caches the result under bazeliskHome. It skips the download if the file already exists and is not outdated. Parameter ´description´ is only used to provide better error messages.
Types ¶
type ContentMerger ¶ added in v1.9.0
Click to show internal directories.
Click to hide internal directories.