# Functions
ClientIP is middleware that adds the client IP address to the context in the request.
Drain finishes reading a response body and closes it.
ExtractClientIP returns the client IP from the given http.Request.
GetClientIP returns the client IP from the context.
GetRequestID returns any request id that had been set in the context.
HardenedTLSConfig returns a tls.Config with the basics configured.
HelloWorld returns a simple HandlerFunc.
IsOK returns true if the response code is a 2xx.
NewHeaderTransport sets up a transport that wraps the provided transport.
NewHTTPServer starts up an HTTP server.
NewUnixSocketHTTPServer starts up an HTTP server listening over a unix socket.
NewUnixSocketRoundTripper sets up an http RoundTripper that will communicate over a unix domain socket.
RequestID sets the request id in the context to a UUID that can be traced throughout the servers req/resp lifecycle.
No description provided by the author
No description provided by the author
UserAgentTransport sets the User-Agent on all requests.
WithClientIP sets the IP in the context.
WithTimeouts sets the server's ReadTimeout, WriteTimeout, and ReadHeaderTimeout.
WithTLSConfig sets the TLS configuration to use on the server.
# Constants
RequestHeader is the header that marks the http request id set by the server.
# Structs
DoerMock is a mock implementation of Doer.
HeaderTransport is an http.RoundTripper that adds a header to each request.
UnixRoundTripper is an http.RoundTripper that makes sure the scheme and host is set correctly to talk over a unix socket.
# Type aliases
ServerOption is used to customize the server.