httputils

package
v0.0.0-...-d95211f Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

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

Jump to

Keyboard shortcuts

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