httpclient

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: GPL-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultTimeout and UploadTimeout are whole-request deadlines assigned to [http.Client.Timeout].
	DefaultTimeout = 45 * time.Second
	UploadTimeout  = 60 * time.Second
)

Variables

This section is empty.

Functions

func CloneWithTimeout

func CloneWithTimeout(base *http.Client, timeout time.Duration) *http.Client

CloneWithTimeout shallow-copies base without mutating it and replaces its timeout. It preserves all other fields; referenced transport and cookie-jar state remain shared. A nil base creates a new client, and a non-positive timeout uses DefaultTimeout.

func New

func New(timeout time.Duration) *http.Client

New returns a client whose timeout defaults to DefaultTimeout when timeout is non-positive.

Types

This section is empty.

Jump to

Keyboard shortcuts

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