Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AccessLog ¶
func AccessLog(conf AccessLoggerConfig) gin.HandlerFunc
func PromMiddleware ¶
func PromMiddleware(appName string) gin.HandlerFunc
func Recovery ¶
func Recovery(handle gin.RecoveryFunc) gin.HandlerFunc
func RegistryMetrics ¶
Types ¶
type AccessLoggerConfig ¶
type AccessLoggerConfig struct { SkipPaths []string `yaml:"skipPaths"` SkipCookie bool `yaml:"skipCookie"` // request body 最大长度展示,0表示采用默认的10240,-1表示不打印 MaxReqBodyLen int `yaml:"maxReqBodyLen"` // response body 最大长度展示,0表示采用默认的10240,-1表示不打印。指定长度的时候需注意,返回的json可能被截断 MaxRespBodyLen int `yaml:"maxRespBodyLen"` // 自定义Skip功能 Skip func(ctx *gin.Context) bool }
access日志打印
Click to show internal directories.
Click to hide internal directories.