httpx

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2026 License: Apache-2.0 Imports: 12 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DownloadFile

func DownloadFile(clientHTTP *http.Client, urlFile string, fileOut string) error

func DownloadFileWithProgress

func DownloadFileWithProgress(clientHTTP *http.Client, urlFile string, fileOut string, progress DownloadProgressFunc) error

func DownloadFileWithResume

func DownloadFileWithResume(clientHTTP *http.Client, urlFile string, fileOut string, progress DownloadProgressFunc) error

func DownloadFileWithResumeOptions

func DownloadFileWithResumeOptions(clientHTTP *http.Client, urlFile string, fileOut string, progress DownloadProgressFunc, options DownloadOptions) error

func IsUnexpectedStatus

func IsUnexpectedStatus(err error, code int) bool

func NewClient

func NewClient(shouldAllowInsecureTLS bool) *http.Client

func RetryAfter

func RetryAfter(err error) time.Duration

Types

type DownloadOptions

type DownloadOptions struct {
	Limiter *RequestLimiter
}

type DownloadProgressFunc

type DownloadProgressFunc func(bytesDone int64, bytesTotal int64)

type RangeIgnoredError

type RangeIgnoredError struct {
	URL string
}

func (RangeIgnoredError) Error

func (err RangeIgnoredError) Error() string

type RequestLimiter

type RequestLimiter struct {
	// contains filtered or unexported fields
}

func NewRequestLimiter

func NewRequestLimiter(requestInterval time.Duration) *RequestLimiter

func (*RequestLimiter) Wait

func (limiter *RequestLimiter) Wait()

type UnexpectedStatusError

type UnexpectedStatusError struct {
	URL         string
	Status      string
	Code        int
	Server      string
	CFMitigated string
	RetryAfter  time.Duration
}

func (UnexpectedStatusError) Error

func (err UnexpectedStatusError) Error() string

Jump to

Keyboard shortcuts

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