constant

package
v0.0.0-...-adb5103 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusMenusNormal 表示菜单状态正常
	StatusMenusNormal = 1

	// StatusMenusForbidden 表示菜单被禁止
	StatusMenusForbidden = 2

	// StatusUserNormal 表示账号正常状态
	StatusUserNormal = 1

	// StatusUserForbidden 表示账号处理停用状态
	StatusUserForbidden = 2
)
View Source
const NormalErrPrefix = "NORMAL_ERROR@"

Variables

View Source
var (
	OK        = ErrInfo{0, ""}
	ErrServer = ErrInfo{500, "server error"}

	ErrParams = ErrInfo{ErrCode: 400, ErrMsg: "接口参数错误"}

	ErrParseToken               = ErrInfo{700, "parse token failed"}
	ErrTokenExpired             = ErrInfo{701, "token is timed out, please log in again"}
	ErrTokenInvalid             = ErrInfo{702, "token is invalid"}
	ErrTokenMalformed           = ErrInfo{703, "that's not even a token"}
	ErrTokenNotValidYet         = ErrInfo{704, "token has been invalidated"}
	ErrTokenUnknown             = ErrInfo{705, "that's not even a token"}
	ErrTokenKicked              = ErrInfo{706, "user has been kicked"}
	ErrTokenDifferentPlatformID = ErrInfo{707, "different platformID"}
	ErrTokenDifferentUserID     = ErrInfo{708, "different userID"}

	ErrAccess                = ErrInfo{ErrCode: 801, ErrMsg: "no permission"}
	ErrDB                    = ErrInfo{ErrCode: 802, ErrMsg: "db failed"}
	ErrArgs                  = ErrInfo{ErrCode: 803, ErrMsg: "args failed"}
	ErrStatus                = ErrInfo{ErrCode: 804, ErrMsg: "status is abnormal"}
	ErrCallback              = ErrInfo{ErrCode: 809, ErrMsg: "callback failed"}
	ErrSendLimit             = ErrInfo{ErrCode: 810, ErrMsg: "send msg limit, to many request, try again later"}
	ErrMessageHasReadDisable = ErrInfo{ErrCode: 811, ErrMsg: "message has read disable"}
	ErrInternal              = ErrInfo{ErrCode: 812, ErrMsg: "internal error"}
	ErrWsConnNotExist        = ErrInfo{ErrCode: 813, ErrMsg: "ws conn not exist"}

	ErrAccountHasRegistered  = ErrInfo{ErrCode: 10002, ErrMsg: "account has been registered"}
	ErrAccountHasNotRegister = ErrInfo{ErrCode: 10003, ErrMsg: "account have not register"}
	ErrPasswordError         = ErrInfo{ErrCode: 10004, ErrMsg: "password error"}
	ErrUpdateError           = ErrInfo{ErrCode: 10005, ErrMsg: "update error"}
	ErrRepeatedError         = ErrInfo{ErrCode: 10005, ErrMsg: "repeated error"}
)

Functions

This section is empty.

Types

type ErrInfo

type ErrInfo struct {
	ErrCode int32
	ErrMsg  string
}

key = errCode, string = errMsg

func (*ErrInfo) Code

func (e *ErrInfo) Code() int32

func (ErrInfo) Error

func (e ErrInfo) Error() string

func (ErrInfo) ToString

func (e ErrInfo) ToString() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL