Versions in this module Expand all Collapse all v2 v2.0.1 Feb 7, 2024 v2.0.0 Jun 15, 2022 Changes in this version + func BasicAuthHeader(username, password string) http.Header + func DefaultHTTPTransport() *http.Transport + func FileProtocolMiddleware(transport *http.Transport) *http.Transport + func ForceAttemptHTTP2Middleware(transport *http.Transport) *http.Transport + func NewHTTPTLSTransport(config TransportConfig) *http.Transport + func ParseBasicAuthHeader(h http.Header) (userid, password string, err error) + func ProxyMiddleware(transport *http.Transport) *http.Transport + func SecureTLSConfig() *tls.Config + type Client struct + func NewClient(options ...Option) *Client + func (c *Client) Client() *http.Client + func (c *Client) Get(ctx context.Context, path string) (resp *http.Response, err error) + type DialBreaker interface + Allowed func(string) bool + Trip func() + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type LocalDialBreaker struct + func NewLocalDialBreaker(allowOutgoingAccess bool) *LocalDialBreaker + func (b *LocalDialBreaker) Allowed(addr string) bool + func (b *LocalDialBreaker) Trip() + type Logger interface + Errorf func(message string, args ...interface{}) + IsTraceEnabled func() bool + Tracef func(message string, args ...interface{}) + type Option func(*options) + func WithCACertificates(value ...string) Option + func WithCookieJar(value http.CookieJar) Option + func WithDisableKeepAlives(value bool) Option + func WithHTTPClient(value *http.Client) Option + func WithLogger(value Logger) Option + func WithRequestRecorder(value RequestRecorder) Option + func WithRequestRetrier(value RetryPolicy) Option + func WithSkipHostnameVerification(value bool) Option + func WithTLSHandshakeTimeout(value time.Duration) Option + func WithTransportMiddlewares(middlewares ...TransportMiddleware) Option + type RequestRecorder interface + Record func(method string, url *url.URL, res *http.Response, rtt time.Duration) + RecordError func(method string, url *url.URL, err error) + type RetryPolicy struct + Attempts int + Delay time.Duration + MaxDelay time.Duration + func (p RetryPolicy) Validate() error + type RoundTripper = http.RoundTripper + type TransportConfig struct + DisableKeepAlives bool + Middlewares []TransportMiddleware + TLSConfig *tls.Config + TLSHandshakeTimeout time.Duration + type TransportMiddleware func(*http.Transport) *http.Transport + func DialContextMiddleware(breaker DialBreaker) TransportMiddleware