Documentation
¶
Index ¶
- Constants
- func Cleanup() rest.Middleware
- func ErrHandler(ctx context.Context, err error) (int, any)
- func GetSuccessMsg(ctx context.Context) string
- func OkHandler(ctx context.Context, data interface{}) any
- func Register()
- func RequestIDMiddleware() rest.Middleware
- func SetSuccessMsg(ctx context.Context, msg string)
- type Response
Constants ¶
View Source
const ( Success = 200 ParamError = 400 Forbidden = 403 NotFound = 404 RateLimit = 429 ServerError = 500 GatewayTimeout = 504 )
业务错误码
Variables ¶
This section is empty.
Functions ¶
func RequestIDMiddleware ¶
func RequestIDMiddleware() rest.Middleware
RequestIDMiddleware 生成并注入 Request ID
Types ¶
Click to show internal directories.
Click to hide internal directories.