Documentation ¶
Index ¶
- func BinaryAdaptor() midl.Adapter
- func ContentLengthFilter(bytes bites.ByteSize) midl.Middleware
- func JSONContentFilter() midl.MiddlewareFunc
- func JobIDValidator(tknKey string, next midl.Middleware) midl.MiddlewareFunc
- func MetricAgg(next http.Handler) http.HandlerFunc
- func New404Handler() midl.Middleware
- func New405Handler() midl.Middleware
- func RegisterGenericHandlers(r *mux.Router)
- func RequestCtxProvider(next http.Handler) http.HandlerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BinaryAdaptor ¶
BinaryAdaptor returns a midl.Adapter instance for responding with application/binary on success and application/json on error.
func ContentLengthFilter ¶
func ContentLengthFilter(bytes bites.ByteSize) midl.Middleware
ContentLengthFilter constructs a middleware filter that enforces the incoming request has a Content-Length header and that the value is below the given threshold.
func JSONContentFilter ¶
func JSONContentFilter() midl.MiddlewareFunc
JSONContentFilter creates a middleware layer that enforces both the existence of the Content-Type header and that the header equals "application/json".
func JobIDValidator ¶
func JobIDValidator( tknKey string, next midl.Middleware, ) midl.MiddlewareFunc
JobIDValidator is a middleware filter that rejects requests that have invalid jobId url parameters.
func MetricAgg ¶
func MetricAgg(next http.Handler) http.HandlerFunc
MetricAgg is an HTTP handler wrapper that records metrics for the wrapped handler.
func New404Handler ¶
func New404Handler() midl.Middleware
New404Handler constructs a generic handler for requests that have no matching registered route.
func New405Handler ¶
func New405Handler() midl.Middleware
New405Handler constructs a generic handler for requests that have no matching route for the request method (e.g. no handler for POST request to /api).
func RegisterGenericHandlers ¶
RegisterGenericHandlers appends generic error generators for unroutable requests to the global router.
func RequestCtxProvider ¶
func RequestCtxProvider(next http.Handler) http.HandlerFunc
RequestCtxProvider wraps an HTTP handler and provides additional context to the request and to the server for the request.
Types ¶
This section is empty.