// HTTPClientFor returns an http.Client that will provide the authentication // or transport level security defined by the provided Config. Will return the // default http.DefaultClient if no special case behavior is needed. func HTTPClientFor(config *Config) (*http.Client, error) { … } // TLSConfigFor returns a tls.Config that will provide the transport level security defined // by the provided Config. Will return nil if no transport level security is requested. func TLSConfigFor(config *Config) (*tls.Config, error) { … } // TransportFor returns an http.RoundTripper that will provide the authentication // or transport level security defined by the provided Config. Will return the // default http.DefaultTransport if no special case behavior is needed. func TransportFor(config *Config) (http.RoundTripper, error) { … } // HTTPWrappersForConfig wraps a round tripper with any relevant layered behavior from the // config. Exposed to allow more clients that need HTTP-like behavior but then must hijack // the underlying connection (like WebSocket or HTTP2 clients). Pure HTTP clients should use // the higher level TransportFor or RESTClientFor methods. func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTripper, error) { … } // TransportConfig converts a client config to an appropriate transport config. func (c *Config) TransportConfig() (*transport.Config, error) { … } // Wrap adds a transport middleware function that will give the caller // an opportunity to wrap the underlying http.RoundTripper prior to the // first API call being made. The provided function is invoked after any // existing transport wrappers are invoked. func (c *Config) Wrap(fn transport.WrapperFunc) { … }