Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewConstructor ¶
NewConstructor returns an Alice-style constructor that enforces a timeout for any handler it decorates. If timeout is nonpositive, a constructor is returned that does no decoration. If timedOut is nil, a default timedOut handler is used that just sets an http.StatusGatewayTimeout response code.
Types ¶
type Options ¶
type Options struct {
// Timeout is the time allowed for the decorated handler's ServeHTTP method to run.
// If unset or nonpositive, no decoration is performed.
Timeout time.Duration
// TimedOut is the optional http.Handler that is executed with the original http.Request
// whenever a timeout occurs. If unset, a default handler is used that simply sets the response
// code to http.StatusGatewayTimeout.
TimedOut http.Handler
}
Options holds the set of configurable options for a timeout constructor.
Click to show internal directories.
Click to hide internal directories.