Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DownloadFromURL ¶
DownloadFromURL downloads a file from an URL and returns the content as a slice of bytes
func IsValidURL ¶
IsValidURL checks whether the given string is a valid URL or not
func TrimHTTPScheme ¶ added in v0.8.5
TrimScheme takes a string of an URL and removes the leading scheme (http or https)
Types ¶
type Downloader ¶
func NewDownloader ¶
func NewDownloader(opts ...DownloaderOption) *Downloader
NewDownloader creates a new Downloader to download files from an URL
func (Downloader) DownloadFromURL ¶
func (d Downloader) DownloadFromURL(URL string) ([]byte, error)
DownloadFromURL downloads a file from an URL and returns the content as a slice of bytes
type DownloaderOption ¶
type DownloaderOption func(*Downloader)
func WithTimeout ¶
func WithTimeout(timeout time.Duration) DownloaderOption
WithTimeout sets a timeout on the underlying HTTP client
Click to show internal directories.
Click to hide internal directories.