Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( OK = New(200, "success") //请求成功 ServerErr = New(500, "server internal error") //服务器内部错误 ParamInvaidErr = New(101, "parameter is invalid") //请求参数错误 TokenInvidErr = New(105, "The param token is invalid") //Token校验失败 PermissionErr = New(109, "premission denied") //授权限制 ForbiddenErr = New(403, "no privilege") //禁止进入 )
All common ecode
Functions ¶
Types ¶
type Code ¶
type Code int
A Code is an int error code spec.
type Codes ¶
type Codes interface { // sometimes Error return Code in string form // NOTE: don't use Error in monitor report even it also work for now Error() string // Code get error code. Code() int // Message get code message. Message() string //Detail get error detail,it may be nil. Details() []interface{} }
Codes ..
Click to show internal directories.
Click to hide internal directories.