Imports #
"errors"
"net/http"
"net/url"
"errors"
"net/http"
"net/url"
TestHooksEnabled is true if interceptors are installed
var TestHooksEnabled = falsevar testInterceptors []InterceptorInterceptor is used to change the host, and maybe the client, for a request to point to a test host.
type Interceptor struct {
Scheme string
FromHost string
ToHost string
Client *http.Client
}DisableTestHooks disables the installed interceptors.
func DisableTestHooks()EnableTestHooks installs the given interceptors to be used by URL and Request.
func EnableTestHooks(interceptors []Interceptor) errorRequest updates the host to actually use for the request, if it is to be intercepted.
func Request(req *http.Request)URL returns the Interceptor to be used for a given URL.
func URL(u *url.URL) (*Interceptor, bool)Generated with Arrow