Documentation ¶
Index ¶
Constants ¶
View Source
const UsernameKey = "username"
View Source
const (
XRequestIDKey = "X-Request-ID"
)
Variables ¶
View Source
var Middlewares = defaultMiddlewares()
Functions ¶
func Context ¶
func Context() gin.HandlerFunc
Context is a middleware that injects common prefix fields to gin.Context.
func RequestID ¶
func RequestID() gin.HandlerFunc
RequestID is a middleware that injects a 'X-Request-ID' into the context and request/response header of each request.
Types ¶
type LoggerOptions ¶
type LoggerOptions struct {
// contains filtered or unexported fields
}
func (*LoggerOptions) Config ¶
func (l *LoggerOptions) Config() *logrus.Logger
initConfig configs logrus.
Click to show internal directories.
Click to hide internal directories.