package intercept
import "cmd/go/internal/web/intercept"
Index ¶
- Variables
- func DisableTestHooks()
- func EnableTestHooks(interceptors []Interceptor) error
- func Request(req *http.Request)
- type Interceptor
Variables ¶
var ( // TestHooksEnabled is true if interceptors are installed TestHooksEnabled = false )
Functions ¶
func DisableTestHooks ¶
func DisableTestHooks()
DisableTestHooks disables the installed interceptors.
func EnableTestHooks ¶
func EnableTestHooks(interceptors []Interceptor) error
EnableTestHooks installs the given interceptors to be used by URL and Request.
func Request ¶
Request updates the host to actually use for the request, if it is to be intercepted.
Types ¶
type Interceptor ¶
Interceptor is used to change the host, and maybe the client, for a request to point to a test host.
func URL ¶
func URL(u *url.URL) (*Interceptor, bool)
URL returns the Interceptor to be used for a given URL.
Source Files ¶
- Version
- v1.24.0-rc.2
- Published
- Jan 13, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 minutes ago –
Tools for package owners.