Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrStrategyFallback = errors.New("fallback to next strategy")
Functions ¶
func RetryPolicy ¶ added in v0.4.0
RetryPolicy wraps retryablehttp.DefaultRetryPolicy and included additional logic: - checks for specific errors that indicate a fall-back to the next download strategy - checks for http.StatusBadGateway and http.StatusServiceUnavailable which also indicate a fall-back
Types ¶
type HTTPClient ¶
func NewHTTPClient ¶ added in v0.2.0
func NewHTTPClient(opts Options) HTTPClient
NewHTTPClient factory function returns a new http.Client with the appropriate settings and can limit number of clients per host if the OptMaxConnPerHost option is set.
type Options ¶ added in v0.2.0
type Options struct { MaxRetries int Transport http.RoundTripper TransportOpts TransportOptions }
type PGetHTTPClient ¶ added in v0.8.2
PGetHTTPClient is a wrapper around http.Client that allows for limiting the number of concurrent connections per host utilizing a client pool. If the OptMaxConnPerHost option is not set, the client pool will not be used.
Click to show internal directories.
Click to hide internal directories.