Documentation ¶
Index ¶
- func New(opts ...Option) (*http.Client, error)
- type Option
- func WithBackoffOpts(opts ...backoff.Option) Option
- func WithDialContext(dx func(ctx context.Context, network, addr string) (net.Conn, error)) Option
- func WithEnableCompression(enable bool) Option
- func WithEnableKeepalives(enable bool) Option
- func WithExpectContinueTimeout(dur string) Option
- func WithForceAttemptHTTP2(force bool) Option
- func WithIdleConnTimeout(dur string) Option
- func WithMaxConnsPerHost(cn int) Option
- func WithMaxIdleConns(cn int) Option
- func WithMaxIdleConnsPerHost(cn int) Option
- func WithMaxResponseHeaderBytes(bs int64) Option
- func WithProxy(px func(*http.Request) (*url.URL, error)) Option
- func WithProxyConnectHeader(header http.Header) Option
- func WithReadBufferSize(bs int64) Option
- func WithResponseHeaderTimeout(dur string) Option
- func WithTLSHandshakeTimeout(dur string) Option
- func WithWriteBufferSize(bs int64) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Option ¶
type Option func(*transport) error
Option represent the functional option for transport.
func WithBackoffOpts ¶
WithBackoffOpts returns the option to set the options to initialize backoff.
func WithDialContext ¶
WithDialContext returns the option to set the dial context.
func WithEnableCompression ¶
WithEnableCompression returns the option to enable compression.
func WithEnableKeepalives ¶ added in v1.3.1
WithEnableKeepalives returns the option to enable keep alive.
func WithExpectContinueTimeout ¶
WithExpectContinueTimeout returns the option to set the expect continue timeout.
func WithForceAttemptHTTP2 ¶
WithForceAttemptHTTP2 returns the option to force attempt HTTP2 for the HTTP transport.
func WithIdleConnTimeout ¶
WithIdleConnTimeout returns the option to set the idle connection timeout.
func WithMaxConnsPerHost ¶
WithMaxConnsPerHost returns the option to set the max connections per host.
func WithMaxIdleConns ¶
WithMaxIdleConns returns the option to set the max idle connection.
func WithMaxIdleConnsPerHost ¶
WithMaxIdleConnsPerHost returns the option to set the max idle connection per host.
func WithMaxResponseHeaderBytes ¶
WithMaxResponseHeaderBytes returns the option to set the max response header bytes.
func WithProxyConnectHeader ¶
WithProxyConnectHeader returns the option to set the proxy connect header.
func WithReadBufferSize ¶
WithReadBufferSize returns the option to set the read buffer size.
func WithResponseHeaderTimeout ¶
WithResponseHeaderTimeout returns the option to set the response header timeout.
func WithTLSHandshakeTimeout ¶
WithTLSHandshakeTimeout returns the option to set the TLS handshake timeout.
func WithWriteBufferSize ¶
WithWriteBufferSize returns the option to set the write buffer size.