http

package
v0.0.0-...-bb113c0 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: AGPL-3.0 Imports: 7 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 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.

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