Documentation ¶
Index ¶
- func InitCounterCode(opt prometheus.CounterOpts)
- func WrapError(fn func(ctx *gin.Context) (Result, error), l logger.Logger, lm LogMessage) gin.HandlerFunc
- func WrapReq[T any](fn func(ctx *gin.Context, req T) (Result, error), l logger.Logger, ...) gin.HandlerFunc
- func WrapReqAndToken[T any, C jwt.Claims](fn func(ctx *gin.Context, req T, uc C) (Result, error), l logger.Logger, ...) gin.HandlerFunc
- func WrapToken[C jwt.Claims](fn func(ctx *gin.Context, uc C) (Result, error), l logger.Logger, ...) gin.HandlerFunc
- type LogMessage
- type Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitCounterCode ¶
func InitCounterCode(opt prometheus.CounterOpts)
InitCounterCode 初始化错误码统计:prometheus错误码统计
func WrapError ¶
func WrapError(fn func(ctx *gin.Context) (Result, error), l logger.Logger, lm LogMessage) gin.HandlerFunc
WrapError 统一处理错误日志打印
func WrapReq ¶
func WrapReq[T any](fn func(ctx *gin.Context, req T) (Result, error), l logger.Logger, lm LogMessage) gin.HandlerFunc
WrapReq 统一处理请求体bind/错误日志打印
func WrapReqAndToken ¶
func WrapReqAndToken[T any, C jwt.Claims](fn func(ctx *gin.Context, req T, uc C) (Result, error), l logger.Logger, lm LogMessage, ctxKey string) gin.HandlerFunc
WrapReqAndToken 统一处理请求体bind/ctx中取值/错误日志打印
Types ¶
type LogMessage ¶
Click to show internal directories.
Click to hide internal directories.