http

package
v0.0.0-...-65751db Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 10 Imported by: 3

Documentation

Overview

Package http provides HTTP utility functions.

Index

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)

func DownloadFile

func DownloadFile(url string, headers map[string]string, filename, destDir string, skipTLSVerify bool) error

DownloadFile is a convenience function that downloads a file with common options.

func DownloadFileAndVerify

func DownloadFileAndVerify(url string, headers map[string]string, filename, destDir string, skipTLSVerify bool) (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.

Jump to

Keyboard shortcuts

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