Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Logger instance
Functions ¶
func GetURLToFile ¶
func GetURLToFile(url, fpath string, fns ...GetURLToFileOptionFn) error
GetURLToFile - Gets the contents of an URL into a file. If the file exists and the file is older than timeout re-download file. Set the timeout to 0 to always download the file. NOTE: This function ignores SSL verification errors
Types ¶
type GetURLToFileOptionFn ¶
type GetURLToFileOptionFn func(*GetURLToFileOptions)
GetURLToFileOptionFn - Options type
func CacheDuration ¶
func CacheDuration(duration time.Duration) GetURLToFileOptionFn
CacheDuration - If the file exists and is older than the cacheDuration then re-download the file, otherwise re-use it.
func Headers ¶
func Headers(headers map[string]string) GetURLToFileOptionFn
Headers - Set request headers
func InsecureSkipVerify ¶
func InsecureSkipVerify() GetURLToFileOptionFn
InsecureSkipVerify - Skips SSL verification
type GetURLToFileOptions ¶
type GetURLToFileOptions struct {
// contains filtered or unexported fields
}
GetURLToFileOptions - Internal options store
Click to show internal directories.
Click to hide internal directories.