Documentation ¶
Index ¶
Constants ¶
View Source
const (
NoResult = "mongo: no documents in result"
)
Variables ¶
View Source
var ( Success = NewError(0, "成功") ServerError = NewError(10000, "服务内部错误") InvalidParams = NewError(10001, "传入参数错误") NotFound = NewError(10002, "未找到对应的资源") TooManyRequests = NewError(10007, "请求过多") DatabaseError = NewError(10008, "数据库处理错误") RedisError = NewError(10009, "缓存处理错误") IDIllegal = NewError(20000, "非法的编号") UsernameExisted = NewError(20001, "用户名已存在") MobileExisted = NewError(20002, "手机号已存在") EmailExisted = NewError(20003, "邮箱已存在") LoginError = NewError(20004, "账号/密码错误") SMSError = NewError(20005, "短信发送失败") )
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
状态错误
func TransMongodbError ¶
func (*Error) Response ¶
func (e *Error) Response(args ...interface{}) *ErrorResponse
func (*Error) StatusCode ¶
type ErrorResponse ¶
type ValidErrors ¶
type ValidErrors []*ValidError
func (ValidErrors) Error ¶
func (v ValidErrors) Error() string
Click to show internal directories.
Click to hide internal directories.