Documentation
      ¶
    
    
  
    
  
    Index ¶
- func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper
 - func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper
 - func NewClient(rt http.RoundTripper) *http.Client
 - func NewDeadlineClient(timeout time.Duration, proxyURL *url.URL) *http.Client
 - func NewDeadlineRoundTripper(timeout time.Duration, proxyURL *url.URL) http.RoundTripper
 - func NewTLSConfig(cfg config.TLSConfig) (*tls.Config, error)
 - type CompressionHandler
 
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBasicAuthRoundTripper ¶ added in v1.0.0
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 NewBearerAuthRoundTripper ¶ added in v1.0.0
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 NewClient ¶ added in v1.0.0
func NewClient(rt http.RoundTripper) *http.Client
NewClient returns a http.Client using the specified http.RoundTripper.
func NewDeadlineClient ¶ added in v1.0.0
NewDeadlineClient returns a new http.Client which will time out long running requests.
func NewDeadlineRoundTripper ¶ added in v1.0.0
NewDeadlineRoundTripper returns a new http.RoundTripper which will time out long running requests.
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.