Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RegisterStatus ¶
RegisterStatus 手动注册业务码对应的 HTTP 状态码 场景:用于注册 401, 403, 404 等特殊状态
Types ¶
type Error ¶
type Error struct {
Code int `json:"code"`
Msg string `json:"msg"`
Details any `json:"details,omitempty"`
// contains filtered or unexported fields
}
Error 标准业务错误结构
func (*Error) WithDetails ¶
WithDetails 链式调用:添加详情 (返回新实例,保证不可变性)
Click to show internal directories.
Click to hide internal directories.