Documentation
¶
Index ¶
- Variables
- func ContextWithResults(ctx context.Context, results []*Result, err error) context.Context
- func HeadersFromRequest(req *http.Request) http.Header
- func WithDefaultHeaders(next http.Handler) http.Handler
- type ErrRequestCanceled
- type Request
- type Requestable
- type RequestableContextKey
- type Result
- type ResultError
- type Results
- type TimeoutError
- type Tripper
Constants ¶
This section is empty.
Variables ¶
View Source
var HopByHopHeaders []string = []string{
"Connection",
"Keep-Alive",
"Proxy-Authenticate",
"Proxy-Authorization",
"TE",
"Trailers",
"Transfer-Encoding",
"Upgrade",
}
Hop-by-hop headers defined here: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers
Functions ¶
func ContextWithResults ¶
func HeadersFromRequest ¶
TODO remove headers listed in the Connection header
Types ¶
type ErrRequestCanceled ¶
type ErrRequestCanceled struct {
// contains filtered or unexported fields
}
func (*ErrRequestCanceled) Error ¶
func (ec *ErrRequestCanceled) Error() string
func (*ErrRequestCanceled) Unwrap ¶
func (ec *ErrRequestCanceled) Unwrap() error
type Request ¶
type Request struct { Header http.Header Timeout time.Duration HmacSecret string Non2xxErrors bool Tripper Tripper SecretFilter secretfilter.Filter // contains filtered or unexported fields }
func NewRequest ¶
func (*Request) WithHeadersFromRequest ¶
func (*Request) WithRequestable ¶
func (r *Request) WithRequestable(requestable Requestable)
type Requestable ¶
func RequestableFromContext ¶
func RequestableFromContext(ctx context.Context) Requestable
type RequestableContextKey ¶
type RequestableContextKey struct{}
type Result ¶
type Result struct { Url string Duration time.Duration HttpResponse *http.Response Body []byte StatusCode int }
func (*Result) HeadersWithoutProxyHeaders ¶
type ResultError ¶
type ResultError struct { Result *Result // contains filtered or unexported fields }
func (*ResultError) Error ¶
func (re *ResultError) Error() string
type Results ¶
func ResultsFromContext ¶
type TimeoutError ¶
type TimeoutError struct {
// contains filtered or unexported fields
}
func (*TimeoutError) Error ¶
func (et *TimeoutError) Error() string
func (*TimeoutError) Unwrap ¶
func (et *TimeoutError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.