# Functions
RequestRewindableWithFile returns a Request suitable for use with Redirect, like 307 redirect for PUT or POST.
No description provided by the author
ClientIP implements a best effort algorithm to return the real client IP, it parses X-Real-IP and X-Forwarded-For in order to work properly with reverse-proxies such us: nginx or haproxy.
go:linkname CloneMultipartFileHeader net/http.cloneMultipartFileHeader.
go:linkname CloneMultipartForm net/http.cloneMultipartForm.
CloneOrMakeHeader invokes Header.Clone but if the result is nil, it'll instead make and return a non-nil Header.go:linkname CloneOrMakeHeader net/http.cloneOrMakeHeader.
CloneTLSConfig returns a shallow clone of cfg, or a new zero tls.Config if cfg is nil.
go:linkname CloneURL net/http.cloneURL.
go:linkname CloneURLValues net/http.cloneURLValues.
No description provided by the author
Do sends an HTTP request and returns an HTTP response, following policy (such as redirects, cookies, auth) as configured on the client.
DoesRequestSatisfyTlsTermination returns whether the request fulfills tls's constraints, https, path matches any whitelisted paths or ip inclued by any cidr whitelistedPath is http path that does not need to be checked allowedTLSCIDR is the network includes ip.
DoJson the same as HttpDo, but bind with json.
DoJsonWithBackoff the same as DoWithBackoff, but bind with json.
DoWithBackoff will retry by exponential backoff if failed.
No description provided by the author
GetProxySchemeAndHost extracts the host and used protocol (either HTTP or HTTPS) from the given request.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Recover and dump HTTP request if broken pipe.
RecoveryClientInterceptor returns a new client interceptors with recovery from panic.
RecoveryServerInterceptor returns a new server interceptors with recovery from panic.
RejectInsecureServerInterceptor returns a new server interceptor with tls check.
RejectInsecureWithAllowedTlsCidrs specifies whether to allow any request which client or proxy's ip included a cidr is a CIDR notation IP address and prefix length, like "192.0.2.0/24" or "2001:db8::/32", as defined in RFC 4632 and RFC 4291.
RejectInsecureWithErrorLog specifies an optional logger for errors.
RejectInsecureWithForceHttp specifies whether to allow any request, as a shortcut circuit.
RejectInsecureWithWhitelistedPaths specifies whether to allow any request which http path matches.
ReplaceHttpRequestBody replace Body and recalculate ContentLength If ContentLength should not be recalculated, save and restore it after ReplaceHttpRequestBody.
StripPrefix returns a handler that serves HTTP requests by removing the given prefix from the request URL's Path and invoking the handler h.
No description provided by the author
No description provided by the author
RequestWithBodyRewindable returns a Request suitable for use with Redirect, like 307 redirect for PUT or POST.
No description provided by the author
ServeContent replies to the request using the content in the provided Reader.
ServerWithDefaults patches a http.Server based on a best practice configuration from Cloudflare: https://blog.cloudflare.com/exposing-go-on-the-internet/
You can override the defaults by mutating the Default* variables exposed by this package.
No description provided by the author
XRequestIdClientInterceptor returns a new client interceptors with x-request-id in context and request's Header.
XRequestIdServerInterceptor returns a new server interceptor with x-request-id in context and response's Header.
# Variables
DefaultCipherSuites defines the recommended cipher suites for modern TLS.
DefaultCurvePreferences defines the recommended elliptic curves for modern TLS.
DefaultIdleTimeout sets the maximum amount of time a Keep-Alive connection can remain idle before being recycled (120s).
DefaultMinVersion defines the recommended minimum version to use for the TLS protocol (1.2).
DefaultReadTimeout sets the maximum time a client has to fully stream a request (5s).
DefaultWriteTimeout sets the maximum amount of time a handler has to fully process a request (10s).
DefaultXRequestIDKey is metadata key name for request ID.
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
EmptyHandlerInterceptorChainOption does not alter the configuration.
EmptyRejectInsecureOption does not alter the configuration.
Workflow interface that allows for customized handler execution chains.
Transport is an http.RoundTripper that makes OAuth 2.0 HTTP requests, wrapping a base RoundTripper and adding an Authorization header with a token from the supplied Sources.
# Interfaces
A HandlerInterceptorChainOption sets options.
A RejectInsecureOption sets options.
No description provided by the author
# Type aliases
HandlerInterceptorChainOptionFunc wraps a function that modifies HandlerInterceptorChain into an implementation of the HandlerInterceptorChainOption interface.
RejectInsecureOptionFunc wraps a function that modifies rejectInsecure into an implementation of the RejectInsecureOption interface.
The HandlerFunc type is an adapter to allow the use of ordinary functions as HTTP handlers.