Documentation
¶
Overview ¶
Package middleware provides HTTP handler useful decorators.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var AccessLevel slog.Level = slog.LevelError + 4
AccessLevel is the log level used for access logs.
Functions ¶
func AccessLog ¶
AccessLog is a decorator/middleware that extracts/ads a correlation id from/to request/response.
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.