http

package
v0.0.0-...-593a473 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 7, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// HTTPClientTimeout specifies a time limit for requests made by a client
	HTTPClientTimeout = 10 * time.Second
	// EnableHttpDebug enable dump of requests and responses of HTTP requests (useful for debug)
	EnableDebug = false
)

Functions

func CaptureRoundTrip

func CaptureRoundTrip(method, scheme, hostname, path, location string, query net_url.Values, headerInfo http.Header, doRedirect bool) (*CapturedRequest, *CapturedResponse, error)

CaptureRoundTrip will perform an HTTP request and return the CapturedRequest and CapturedResponse tuple

Types

type CapturedRequest

type CapturedRequest struct {
	Path    string              `json:"path"`
	Host    string              `json:"host"`
	Method  string              `json:"method"`
	Proto   string              `json:"proto"`
	Headers map[string][]string `json:"headers"`

	Namespace string `json:"namespace"`
	Ingress   string `json:"ingress"`
	Service   string `json:"service"`
	Pod       string `json:"pod"`
}

CapturedRequest contains the original HTTP request metadata as received by the echoserver handling the test request.

type CapturedResponse

type CapturedResponse struct {
	StatusCode    int
	ContentLength int64
	Proto         string
	Headers       map[string][]string
	TLSHostname   string

	Certificate *x509.Certificate
}

CapturedResponse contains the HTTP response metadata from the echoserver.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL