Documentation ¶
Overview ¶
Package artifact contains utilities for working downloading files.
Index ¶
- func FileCopy(log log.T, destinationPath string, src io.Reader) (written int64, err error)
- func Md5HashValue(log log.T, filePath string) (hash string, err error)
- func Sha256HashValue(log log.T, filePath string) (hash string, err error)
- func VerifyHash(log log.T, input DownloadInput, output DownloadOutput) (match bool, err error)
- type DownloadInput
- type DownloadOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Md5HashValue ¶
Md5HashValue gets the md5 hash value
func Sha256HashValue ¶
Sha256HashValue gets the sha256 hash value
func VerifyHash ¶
func VerifyHash(log log.T, input DownloadInput, output DownloadOutput) (match bool, err error)
VerifyHash verifies the hash of the url file as per specified hash algorithm type and its value
Types ¶
type DownloadInput ¶
type DownloadInput struct { SourceURL string DestinationDirectory string SourceHashValue string SourceHashType string }
DownloadInput specifies the input to file download operation
type DownloadOutput ¶
DownloadOutput holds the result of file download operation.
func Download ¶
func Download(log log.T, input DownloadInput) (output DownloadOutput, err error)
Download is a generic utility which attempts to download smartly.
Click to show internal directories.
Click to hide internal directories.