Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(options ...ClientOption) *http.Client
NewClient returns a new Client.
func NewClientWithTransport ¶
func NewClientWithTransport(transport http.RoundTripper) *http.Client
NewClientWithTransport returns a new Client with the given transport. This is a separate constructor so that it's clear it cannot be used in combination with other ClientOptions.
Types ¶
type ClientInterceptorFunc ¶ added in v1.8.0
type ClientInterceptorFunc func(http.RoundTripper) http.RoundTripper
ClientInterceptorFunc is a function that wraps a RoundTripper with any interceptors
type ClientOption ¶
type ClientOption func(*clientOptions)
ClientOption is an option for a new Client.
func WithH2C ¶ added in v1.8.0
func WithH2C() ClientOption
WithH2C returns a new ClientOption that allows dialing h2c (cleartext) servers.
func WithInterceptorFunc ¶ added in v1.8.0
func WithInterceptorFunc(interceptorFunc ClientInterceptorFunc) ClientOption
WithInterceptorFunc returns a new ClientOption to use a given interceptor.
func WithObservability ¶ added in v1.8.0
func WithObservability(tags ...tag.Mutator) ClientOption
WithObservability returns a new ClientOption to use OpenCensus tracing and metrics.
The default is to use no observability.
func WithProxy ¶ added in v1.8.0
func WithProxy(proxyFunc Proxy) ClientOption
WithProxy returns a new ClientOption to use a proxy.
The default is to use http.ProxyFromEnvironment
func WithTLSConfig ¶ added in v1.8.0
func WithTLSConfig(tlsConfig *tls.Config) ClientOption
WithTLSConfig returns a new ClientOption to use the tls.Config.
The default is to use no TLS.