Documentation
¶
Overview ¶
Package http provides HTTP utility functions.
Index ¶
- func Download(url, destDir, filename string, opts DownloadOptions) error
- func DownloadAndVerify(url, destDir, filename string, opts DownloadOptions) (verified bool, err error)
- func DownloadFile(url string, headers map[string]string, filename, destDir string, ...) error
- func DownloadFileAndVerify(url string, headers map[string]string, filename, destDir string, ...) (verified bool, err error)
- type DownloadOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Download ¶
func Download(url, destDir, filename string, opts DownloadOptions) error
Download downloads a file from the given URL to the specified destination.
func DownloadAndVerify ¶
func DownloadAndVerify(url, destDir, filename string, opts DownloadOptions) (verified bool, err error)
Types ¶
type DownloadOptions ¶
type DownloadOptions struct {
// Headers to include in the request
Headers map[string]string
// SkipTLSVerify skips TLS certificate validation
SkipTLSVerify bool
// Timeout for the download (default: 5 minutes)
Timeout time.Duration
}
DownloadOptions configures a download request.
func DefaultOptions ¶
func DefaultOptions() DownloadOptions
DefaultOptions returns default download options.
Click to show internal directories.
Click to hide internal directories.