Documentation ¶
Index ¶
- func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper
- func NewBearerAuthFileRoundTripper(bearerFile string, rt http.RoundTripper) http.RoundTripper
- func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper
- func NewClientFromConfig(cfg config_util.HTTPClientConfig, name string) (*http.Client, error)
- func NewTLSConfig(cfg config_util.TLSConfig) (*tls.Config, error)
- type CompressionHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicAuthRoundTripper ¶
func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper
NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a request unless it has already been set.
func NewBearerAuthFileRoundTripper ¶
func NewBearerAuthFileRoundTripper(bearerFile string, rt http.RoundTripper) http.RoundTripper
NewBearerAuthFileRoundTripper adds the bearer token read from the provided file to a request unless the authorization header has already been set. This file is read for every request.
func NewBearerAuthRoundTripper ¶
func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper
NewBearerAuthRoundTripper adds the provided bearer token to a request unless the authorization header has already been set.
func NewClientFromConfig ¶ added in v1.6.0
func NewClientFromConfig(cfg config_util.HTTPClientConfig, name string) (*http.Client, error)
NewClientFromConfig returns a new HTTP client configured for the given config.HTTPClientConfig. The name is used as go-conntrack metric label.
func NewTLSConfig ¶
func NewTLSConfig(cfg config_util.TLSConfig) (*tls.Config, error)
NewTLSConfig creates a new tls.Config from the given config_util.TLSConfig.
Types ¶
type CompressionHandler ¶
CompressionHandler is a wrapper around http.Handler which adds suitable response compression based on the client's Accept-Encoding headers.
func (CompressionHandler) ServeHTTP ¶
func (c CompressionHandler) ServeHTTP(writer http.ResponseWriter, req *http.Request)
ServeHTTP adds compression to the original http.Handler's ServeHTTP() method.