Documentation ¶
Index ¶
- func CacheControl(cacheHeaderValue string) mux.MiddlewareFunc
- func ContentType(h http.Handler) http.Handler
- func LogEntryMiddleware(lggr *log.Logger) mux.MiddlewareFunc
- func NewFilterMiddleware(mf *module.Filter, upstreamEndpoint string) mux.MiddlewareFunc
- func NewValidationMiddleware(client *http.Client, validatorHook string) mux.MiddlewareFunc
- func RequestLogger(h http.Handler) http.Handler
- func WithRequestID(h http.Handler) http.Handler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CacheControl ¶
func CacheControl(cacheHeaderValue string) mux.MiddlewareFunc
CacheControl takes a string and makes a header value to the key Cache-Control. This is so you can set some sane cache defaults to certain endpoints.
func ContentType ¶ added in v0.3.0
ContentType writes an application/json Content-Type header.
func LogEntryMiddleware ¶
func LogEntryMiddleware(lggr *log.Logger) mux.MiddlewareFunc
LogEntryMiddleware builds a log.Entry, setting the request fields and storing it in the context to be used throughout the stack.
func NewFilterMiddleware ¶
func NewFilterMiddleware(mf *module.Filter, upstreamEndpoint string) mux.MiddlewareFunc
NewFilterMiddleware builds a middleware function that implements the filters configured in the filter file.
func NewValidationMiddleware ¶
func NewValidationMiddleware(client *http.Client, validatorHook string) mux.MiddlewareFunc
NewValidationMiddleware builds a middleware function that performs validation checks by calling an external webhook.
func RequestLogger ¶ added in v0.3.0
RequestLogger logs request params to standard output it should only be used during dev.
Types ¶
This section is empty.