Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( SuccT = &T{Code: SuccErrCode, Msg: ErrCodeMsg[SuccErrCode], Data: nil} FailT = &T{Code: FailErrCode, Msg: ErrCodeMsg[FailErrCode], Data: nil} InternalErrT = &T{Code: InternalErrCode, Msg: ErrCodeMsg[InternalErrCode], Data: nil} ParamErrT = &T{Code: ParamErrCode, Msg: ErrCodeMsg[ParamErrCode], Data: nil} AuthErrT = &T{Code: AuthErrCode, Msg: ErrCodeMsg[AuthErrCode], Data: nil} PermErrT = &T{Code: PermErrCode, Msg: ErrCodeMsg[PermErrCode], Data: nil} ExistErrT = &T{Code: ExistErrCode, Msg: ErrCodeMsg[ExistErrCode], Data: nil} NotFoundErrT = &T{Code: NotFoundErrCode, Msg: ErrCodeMsg[NotFoundErrCode], Data: nil} LimitErrT = &T{Code: LimitErrCode, Msg: ErrCodeMsg[LimitErrCode], Data: nil} TimeoutErrT = &T{Code: TimeoutErrCode, Msg: ErrCodeMsg[TimeoutErrCode], Data: nil} OtherErrT = &T{Code: OtherErrCode, Msg: ErrCodeMsg[OtherErrCode], Data: nil} MethodErrT = &T{Code: MethodErrCode, Msg: ErrCodeMsg[MethodErrCode], Data: nil} )
View Source
var ErrCodeMsg = map[RespCode]string{ SuccErrCode: "ok", FailErrCode: "操作失败", InternalErrCode: "内部错误", ParamErrCode: "参数错误", AuthErrCode: "认证失败", PermErrCode: "无权限", ExistErrCode: "数据已存在", NotFoundErrCode: "数据未找到", LimitErrCode: "已限制操作", TimeoutErrCode: "超时错误", OtherErrCode: "未知错误", MethodErrCode: "方法错误", }
Functions ¶
This section is empty.
Types ¶
type T ¶
type T struct { Code RespCode `json:"code"` Msg string `json:"msg"` Data interface{} `json:"data"` }
func InternalErr ¶
func InternalErr() *T
func NotFoundErr ¶
func NotFoundErr() *T
func TimeoutErr ¶
func TimeoutErr() *T
Click to show internal directories.
Click to hide internal directories.