Documentation ¶
Overview ¶
Package download provides a simple way to download files from the internet as fast as possible.
Index ¶
- func Backoff(dur time.Duration) *delay
- func DefaultPooledTransport() *http.Transport
- func DefaultTransport() *http.Transport
- func GetProxy(proxy string) func(*http.Request) (*url.URL, error)
- func NewRangeReader()
- func RandomAgent() string
- func Retry(attempts int, sleep *delay, f func() error) (err error)
- func RetryWithContext(ctx context.Context, attempts int, sleep *delay, f func() error) (err error)
- type Config
- type HttpError
- type Manager
- type Part
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultPooledTransport ¶
DefaultPooledTransport returns a new http.Transport with similar default values to http.DefaultTransport. Do not use this for transient transports as it can leak file descriptors over time. Only use this for transports that will be re-used for the same host(s).
func DefaultTransport ¶
DefaultTransport returns a new http.Transport with similar default values to http.DefaultTransport, but with idle connections and keepalives disabled.
func GetProxy ¶
GetProxy takes either an input string or read the enviornment and returns a proxy function
func NewRangeReader ¶
func NewRangeReader()
func RandomAgent ¶
func RandomAgent() string
Types ¶
type Manager ¶
type Manager struct { URL *url.URL Hash any DestName string AcceptRanges string ContentType string ContentAge string ContentDate string ContentSha256 string ContentSha1 string ContentLength int64 Redirected bool Headers map[string]string Elapsed time.Duration Parts []*Part // contains filtered or unexported fields }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.