Documentation
¶
Index ¶
Constants ¶
View Source
const ( SUCCESS = 200 ERROR = 500 BadRequest = 400 Forbidden = 403 NotFound = 404 MethodNotAllowed = 405 UserError = 1000 ErrorUsernameUsed = 1001 ErrorPasswordWrong = 1002 ErrorUserNotExist = 1003 ErrorUserInactive = 1004 ErrorEmailUsed = 1005 ErrorInvalidEmail = 1006 ErrorInvalidRole = 1007 ErrorEmptyDisplayName = 1008 ErrorInvalidAvatarURL = 1009 AuthError = 2000 ErrorTokenInvalid = 2001 ErrorNoPermission = 2002 CategoryError = 3000 ErrorCateNameUsed = 3001 ErrorCateNotExist = 3002 ErrorEmptyCateName = 3003 ArticleError = 4000 ErrorArtNotExist = 4001 ErrorArtTitleEmpty = 4002 ErrorArtContent = 4003 ErrorPasswordTooShort = 1010 )
Variables ¶
This section is empty.
Functions ¶
func GetHTTPStatus ¶
func IsClientError ¶
func IsServerError ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse struct { Code int `json:"code"` Message string `json:"message"` Detail string `json:"detail,omitempty"` }
func NewError ¶
func NewError(code int, detail string) ErrorResponse
func (ErrorResponse) Error ¶
func (e ErrorResponse) Error() string
Click to show internal directories.
Click to hide internal directories.