var (
// TestHooksEnabled is true if interceptors are installed
TestHooksEnabled = false
)
func DisableTestHooks()
DisableTestHooks disables the installed interceptors.
func EnableTestHooks(interceptors []Interceptor) error
EnableTestHooks installs the given interceptors to be used by URL and Request.
func Request(req *http.Request)
Request updates the host to actually use for the request, if it is to be intercepted.
Interceptor 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
}
func URL(u *url.URL) (*Interceptor, bool)
URL returns the Interceptor to be used for a given URL.