Documentation
¶
Overview ¶
Package middleware provides HTTP handler useful decorators.
Index ¶
- func AccessLog(next http.Handler, logger xlog.Logger, opts ...AccessLogOpts) http.Handler
- func ContextWithLogger(next http.Handler, logger xlog.Logger) http.Handler
- func CorrelationID(next http.Handler, makeCorrelationID xtransport.CorrelationIDFactory) http.Handler
- func Recover(next http.Handler, logger xlog.Logger) http.Handler
- type AccessLogOpts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessLog ¶
AccessLog is a decorator/middleware that extracts/ads a correlation id from/to request/response.
func ContextWithLogger ¶
ContextWithLogger is a decorator/middleware that sets the logger on request context.
func CorrelationID ¶
func CorrelationID(next http.Handler, makeCorrelationID xtransport.CorrelationIDFactory) http.Handler
CorrelationID is a decorator/middleware that extracts/ads a correlation id from/to request/response.
Types ¶
type AccessLogOpts ¶
type AccessLogOpts struct {
// SkipMethods specifies the http methods to skip logging for.
SkipMethods []string
// ObfuscatePathValues specifies the request url parts that should be obscure.
// Last maximum 8 chars from it will be replaced with "*".
ObfuscatePathValues []string
}
AccessLogOpts holds some configuration for access log.
Click to show internal directories.
Click to hide internal directories.