Documentation ¶
Index ¶
- Constants
- type Error
- func BadRequest(errorMsg string, errorCode ...int) *Error
- func Forbidden(errorMsg string, errorCode ...int) *Error
- func InternalServer(errorMsg string) *Error
- func New(httpCode, errorCode int, errorMsg string) *Error
- func NotFound(errorMsg string, errorCode ...int) *Error
- func TooManyRequestsErr(errorMsg string) *Error
- func Unauthorized(errorMsg string, errorCode ...int) *Error
- func ValidateErr(errorMsg string) *Error
Constants ¶
View Source
const ( DEFAULT_ERROR = 40000 // 默认错误 VALIDATE_ERROR = 42200 // 验证错误 TOKEN_ERROR = 40100 // Token失效 FORBIDDEN = 40300 // 无权限 NOT_FOUND = 40400 // 数据不存在 TOO_MANY_REQUESTS = 42900 // 请求过于频繁 USER_NOT_FOUND = 40401 // 用户不存在 SERVER_ERROR = 50000 // 服务器错误 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func BadRequest ¶
func InternalServer ¶
func TooManyRequestsErr ¶
func Unauthorized ¶
func ValidateErr ¶
Click to show internal directories.
Click to hide internal directories.