Documentation ¶
Index ¶
- Variables
- type Code
- func (e *Code) Code() int
- func (e *Code) Data() interface{}
- func (e *Code) Details() []string
- func (e *Code) Error() string
- func (e *Code) HaveDetails() bool
- func (e *Code) Msg() string
- func (e *Code) Msgf(args []interface{}) string
- func (e *Code) Status() bool
- func (e *Code) StatusCode() int
- func (e *Code) WithData(data interface{}) *Code
- func (e *Code) WithDetails(details ...string) *Code
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //Success = NewError(1, "成功") Success = NewSuss(1, "成功") ErrorNotFoundAPI = NewError(incr(404), "找不到API") ErrorInvalidParams = NewError(incr(404), "缺少请求参数") ErrorTooManyRequests = NewError(incr(404), "请求过多") ErrorInvalidAuthToken = NewError(incr(404), "验证授权Token失败") ErrorInvalidToken = NewError(incr(404), "缺少用户凭证Token") ErrorServerInternal = NewError(incr(500), "服务内部错误") )
View Source
var (
ErrorUploadFileFail = NewError(incr(600), "上传文件失败")
)
Functions ¶
This section is empty.
Types ¶
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
func (*Code) HaveDetails ¶
func (*Code) StatusCode ¶
func (*Code) WithDetails ¶
Click to show internal directories.
Click to hide internal directories.