Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface {
// Do matches http.Client.
//
// This allows Client to be dropped in for http.Client.
Do(request *http.Request) (*http.Response, error)
// ParseAddress parses the given address.
//
// If the address has a scheme, this is a no-op.
// If the address does not have a scheme, this adds https:// if TLS was configured,
// and http:// if TLS was not configured.
ParseAddress(address string) string
// Transport returns the http.RoundTripper configured on
// this client.
Transport() http.RoundTripper
}
Client is a client.
func NewClientWithTransport ¶
func NewClientWithTransport(transport http.RoundTripper) 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.
type ClientOption ¶
type ClientOption func(*client)
ClientOption is an option for a new Client.
func ClientWithObservability ¶
func ClientWithObservability() ClientOption
ClientWithObservability returns a new ClientOption to use OpenCensus tracing and metrics.
The default is to use no observability.
func ClientWithProxy ¶ added in v1.7.0
func ClientWithProxy(proxyFunc Proxy) ClientOption
WithProxy returns a new ClientOption to use a proxy.
The default is to use http.ProxyFromEnvironment
func ClientWithTLSConfig ¶
func ClientWithTLSConfig(tlsConfig *tls.Config) ClientOption
ClientWithTLSConfig returns a new ClientOption to use the tls.Config.
The default is to use no TLS.
Click to show internal directories.
Click to hide internal directories.