Documentation ¶
Index ¶
Constants ¶
View Source
const ( // ShutdownTimeout is the maximum time to wait for the HTTP server to shutdown. ShutdownTimeout time.Duration = 30 * time.Second // ReadHeaderTimeout is the maximum time to wait for reading an HTTP request header. ReadHeaderTimeout time.Duration = 60 * time.Second )
View Source
const ( // PatternMetricsHandler is the path pattern to use for the metrics handler. PatternMetricsHandler = "/metrics" // PatternRelayHandler is the path pattern to use for the relay handler. PatternRelayHandler = "/relay" )
View Source
const (
// QueryParamTarget is the request query parameter used for providing the relay target.
QueryParamTarget = "target"
)
View Source
const ( // ResponseHeaderTimeout is the maximum time to wait for reading an HTTP response header. ResponseHeaderTimeout = 60 * time.Second )
Variables ¶
View Source
var ( // ErrMissingQueryParam is returned when a client request is missing a query parameter. ErrMissingQueryParam = errors.New("missing query parameter") )
Errors used by the server package.
Functions ¶
func Error ¶ added in v2.5.0
Error replies to the request with the specified error message and HTTP code. It also logs the request remote address, error and code as a warning.
func NewServeMux ¶ added in v2.5.0
NewServeMux creates a top-level request multiplexer for the application.
func RelayHandler ¶
RelayHandler is an http.Handler for target relay requests.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.