Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func OverrideCacheControl ¶
OverrideCacheControl creates a value that overrides the Cache-Control header.
Types ¶
type InterceptFullFunc ¶
InterceptFullFunc is the full version of InterceptFunc: the next callback also returns a response.
type InterceptFunc ¶
InterceptFunc is a function for intercepting a request. The request being intercepted is given, as well as a callback that triggers the actual request.
type Interceptor ¶
type Interceptor struct {
// contains filtered or unexported fields
}
Interceptor wraps around an existing roundtripper and calls the registered callbacks on each request.
func WrapInterceptor ¶
func WrapInterceptor(c http.RoundTripper) *Interceptor
WrapInterceptor wraps the given RoundTripper inside a Interceptor.
func (*Interceptor) AddIntercept ¶
func (r *Interceptor) AddIntercept(f InterceptFunc) func()
AddIntercept adds the given callback. The callback is called when RoundTrip is called.
func (*Interceptor) AddInterceptFull ¶
func (r *Interceptor) AddInterceptFull(f InterceptFullFunc) func()
AddIntercept adds the given callback. The callback is called when RoundTrip is called.
type RoundTripWrapper ¶
RoundTripWrapper wraps a http.RoundTripper for debugging.
type TransportHeaderOverride ¶
type TransportHeaderOverride struct { R http.RoundTripper H map[string]map[string]string }
TransportHeaderOverride overrides the header of all incoming responses matching the path inside the map. It is used for caching.