Documentation
¶
Index ¶
Constants ¶
View Source
const ( // ErrInvalidAuthHeader - 400: Invalid auth header. ErrInvalidAuthHeader int = iota + 100701 // ErrSignatureInvalid - 400: Signature invalid. ErrSignatureInvalid )
View Source
const ( // ErrNicknameEmpty - 400: Nickname is empty. ErrNicknameEmpty int = iota + 100601 // ErrFriendAlreadyExist - 400: Friend already exist. ErrFriendAlreadyExist // ErrFriendReqAlreadyCommit - 400: Friend request already commit. ErrFriendReqAlreadyCommit )
View Source
const ( // ErrParam - 400: Param error. ErrParam int = iota + 100501 // ErrTokenCreate - 400: Token create failed. ErrTokenCreate // ErrServerInternal - 500: Server internal error. ErrServerInternal )
View Source
const ( // ErrUserNotFound - 404: User not found. ErrUserNotFound int = iota + 100401 // ErrUserAlreadyExists - 400: User already exists. ErrUserAlreadyExists // ErrUserPasswordIncorrect - 400: User password incorrect. ErrUserPasswordIncorrect // ErrSmsSend - 400: Send sms error. ErrSmsSend // ErrCodeNotExist - 400: Sms code incorrect or expired. ErrCodeNotExist // ErrCodeIncorrect - 400: Verify code incorrect. ErrCodeIncorrect )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrCode ¶
type ErrCode struct { // C refers to the code of the ErrCode. C int // HTTP status that should be used for the associated error code. HTTP int // External (user) facing error text. Ext string // Ref specify the reference document. Ref string }
ErrCode implements Coder interface.
func (ErrCode) HTTPStatus ¶
HTTPStatus returns the associated HTTP status code, if any. Otherwise, returns 200.
Click to show internal directories.
Click to hide internal directories.