Documentation
¶
Index ¶
- func InitErrCodeMetrics(opt prometheus.CounterOpts)
- func Wrap(l logx.Logger, bizFn func(ctx *gin.Context) (Result, error)) gin.HandlerFunc
- func WrapBody[T any](l logx.Logger, bizFn func(ctx *gin.Context, req T) (Result, error)) gin.HandlerFunc
- type Handler
- type Result
- func BizError(msg string) Result
- func InternalError() Result
- func InternalErrorWithMsg(msg string) Result
- func InvalidParam() Result
- func InvalidParamWithMsg(msg string) Result
- func InvalidToken() Result
- func NoPermission() Result
- func NotFound() Result
- func Success() Result
- func SuccessWithData(data any) Result
- func SuccessWithMsg(msg string) Result
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitErrCodeMetrics ¶
func InitErrCodeMetrics(opt prometheus.CounterOpts)
InitErrCodeMetrics 初始化错误码统计 注意:要使用wrap功能,必须调用该方法初始化vector
Types ¶
type Handler ¶
type Handler interface {
RegisterRoutes(server *gin.RouterGroup)
}
type Result ¶
func InternalError ¶
func InternalError() Result
func InternalErrorWithMsg ¶
func InvalidParam ¶
func InvalidParam() Result
func InvalidParamWithMsg ¶
func InvalidToken ¶
func InvalidToken() Result
func NoPermission ¶
func NoPermission() Result
func SuccessWithData ¶
func SuccessWithMsg ¶
Click to show internal directories.
Click to hide internal directories.