Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsRedirect ¶ added in v0.6.0
IsRedirect returns true if a given status code is a redirect code.
Types ¶
type CapturedRequest ¶
type CapturedRequest struct { Path string `json:"path"` Host string `json:"host"` Method string `json:"method"` Protocol string `json:"proto"` Headers map[string][]string `json:"headers"` Namespace string `json:"namespace"` Pod string `json:"pod"` }
CapturedRequest contains request metadata captured from an echoserver response.
type CapturedResponse ¶
type CapturedResponse struct { StatusCode int ContentLength int64 Protocol string Headers map[string][]string RedirectRequest *RedirectRequest }
CapturedResponse contains response metadata.
type DefaultRoundTripper ¶
type DefaultRoundTripper struct { Debug bool TimeoutConfig config.TimeoutConfig CustomDialContext func(context.Context, string, string) (net.Conn, error) }
DefaultRoundTripper is the default implementation of a RoundTripper. It will be used if a custom implementation is not specified.
func (*DefaultRoundTripper) CaptureRoundTrip ¶
func (d *DefaultRoundTripper) CaptureRoundTrip(request Request) (*CapturedRequest, *CapturedResponse, error)
CaptureRoundTrip makes a request with the provided parameters and returns the captured request and response from echoserver. An error will be returned if there is an error running the function but not if an HTTP error status code is received.
type RedirectRequest ¶ added in v0.6.0
RedirectRequest contains a follow up request metadata captured from a redirect response.
type Request ¶
type Request struct { URL url.URL Host string Protocol string Method string Headers map[string][]string UnfollowRedirect bool CertPem []byte KeyPem []byte Server string }
Request is the primary input for making a request.
type RoundTripper ¶
type RoundTripper interface {
CaptureRoundTrip(Request) (*CapturedRequest, *CapturedResponse, error)
}
RoundTripper is an interface used to make requests within conformance tests. This can be overridden with custom implementations whenever necessary.