Documentation
¶
Index ¶
Constants ¶
const RetryCount = 3
Variables ¶
This section is empty.
Functions ¶
func DefaultTransport ¶ added in v0.115.0
func DefaultTransport() http.RoundTripper
DefaultTransport returns a RoundTripper with retry and proxy support. Use when a third-party library needs a transport rather than a full http.Client.
func NewPlainClient ¶ added in v0.115.0
NewPlainClient returns an HTTP client with proxy support but no retry.
func NewRetryClient ¶ added in v0.84.1
func NewThrottledRetryClient ¶ added in v0.115.0
NewThrottledRetryClient returns an HTTP client with rate limiting wrapping retry + proxy.
func ProxyOnlyTransport ¶ added in v0.115.0
func ProxyOnlyTransport() http.RoundTripper
ProxyOnlyTransport returns a RoundTripper with proxy support but no retry. Use when the caller handles its own retry (e.g. go-containerregistry) or for non-idempotent operations (e.g. OAuth token exchange) where retry is unsafe.
Types ¶
type HTTPClient ¶
type HTTPClient interface {
Do(req *http.Request) (*http.Response, error)
Get(url string) (*http.Response, error)
}
HTTPClient interface to define the contract of ALL http client to be used (http package or mocks)
type MockClient ¶ added in v0.19.0
MockClient is a stub implementation of an http.Client with a custom `Do` method