Documentation
¶
Index ¶
Constants ¶
View Source
const ContextKey = "correlationid"
ContextKey is the key the retrieved (or generated) correlation ID is stored under in the gin Context.
Variables ¶
This section is empty.
Functions ¶
func LogrusLogger ¶
func LogrusLogger(logger logrus.FieldLogger, ctx *gin.Context) logrus.FieldLogger
LogrusLogger returns a new logger instance with a correlation ID in it.
func Middleware ¶
func Middleware(opts ...MiddlewareOption) gin.HandlerFunc
Middleware returns a gin compatible handler.
Types ¶
type Header ¶
type Header string
Header configures the header from where the correlation ID will be retrieved.
type MiddlewareOption ¶
type MiddlewareOption interface {
// contains filtered or unexported methods
}
MiddlewareOption configures the correlation ID middleware.
Click to show internal directories.
Click to hide internal directories.