result

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2022 License: Zlib Imports: 1 Imported by: 7

Documentation

Index

Constants

View Source
const (
	ERR_OK            = int32(0x000)
	ERR_AUTH          = int32(0x001)
	ERR_REG           = int32(0x002)
	ERR_SESSION       = int32(0x003)
	ERR_TOKEN         = int32(0x004)
	ERR_EXCEPTION     = int32(0x005)
	ERR_REQ           = int32(0x006)
	ERR_LOGIN         = int32(0x007)
	ERR_PARAM         = int32(0x008)
	ERR_JSON          = int32(0x009)
	ERR_NIL           = int32(0x00A)
	ERR_TIMEOUT       = int32(0x00B)
	ERR_NOT_FOUND     = int32(0x00C)
	ERR_NOT_SUPPORT   = int32(0x00D)
	ERR_NOT_IMPLEMENT = int32(0x00E)
	ERR_FILE_NOEXIST  = int32(0x00F)
	ERR_UPLOAD        = int32(0x010)
	ERR_BIND          = int32(0x011)
	ERR_SMS           = int32(0x012)
	ERRILLEGAL        = int32(0x013)
	ERR_SENSITIVE     = int32(0x014)
	ERR_VERSION       = int32(0x015)
)

low bit16

View Source
const (
	REG_INFO        = int32(0x001000) //注册信息不完
	REG_EXISTED     = int32(0x002000) //已存在
	REG_ACTIVATED   = int32(0x003000) //需要激活
	TOKEN_MALFORMED = int32(0x004000) //TOKEN 格式错误
	TOKEN_SIGNED    = int32(0x005000) //TOKEN 答名失败
	TOKEN_VALIDATE  = int32(0x006000) //TOKEN 验证失败
	TOKEN_EXPIRED   = int32(0x007000) //TOKEN 过期
	TOKEN_OTHER     = int32(0x008000) //TOKEN
	TOKEN_UNVER     = int32(0x009000)
)

子项 high bit16

View Source
const (
	ERRI_SAVE            = 0x10000000
	ERRI_MEDIA_CODE      = 0x11000000
	ERRI_SERVICE         = 0x12000000
	ERRI_WX              = 0x13000000
	ERRI_EMAIL           = 0x14000000
	ERRI_SMS             = 0x15000000
	ERRI_GROUP           = 0x16000000
	ERRI_INIT            = 0x17000000
	ERRI_DB              = 0x18000000
	ERRI_MQ_INIT         = 0x19000000
	ERRI_MQ_START        = 0x1A000000
	ERRI_MQ_PUBLISH      = 0x1B000000
	ERRI_RDS_START       = 0x1C000000
	ERRI_RDS_PING        = 0x1D000000
	ERRI_RDS_CFG         = 0x1E000000
	ERRI_RDS_DEL         = 0x1F000000
	ERRI_RDS_SET         = 0x20000000
	ERRI_RDS_GET         = 0x21000000
	ERRI_DB_START        = 0x22000000
	ERRI_DB_CFG          = 0x23000000
	ERRI_DB_OPEN         = 0x24000000
	ERRI_DB_EXIST        = 0x25000000
	ERRI_ES_START        = 0x26000000
	ERRI_ES_CFG          = 0x27000000
	ERRI_ES_CLIENT       = 0x28000000
	ERRI_ES_PING         = 0x29000000
	ERRI_LISTEN          = 0x2A000000
	ERRI_SERVE           = 0x2B000000
	ERRI_CLIENT_CONNECT  = 0x2C000000
	ERRI_CLIENT_NIL      = 0x2D000000
	ERRI_SEND            = 0x2E000000
	ERRI_READ            = 0x2F000000
	ERRI_VE_CREATERENDER = 0x30000000
	ERRI_VE_RENDERSTART  = 0x31000000
	ERRI_VE_RENDER       = 0x32000000
	ERRI_VE              = 0x33000000
	ERRI_ETCD            = 0x34000000
	ERRI_ETCD_CLOSED     = 0x35000000
	ERRI_ETCD_START      = 0x36000000
	ERRI_ETCD_STOP       = 0x37000000
	ERRI_TRY             = 0x38000000
	ERRI_WARNING         = 0x39000000
)

内部错误ID

Variables

This section is empty.

Functions

This section is empty.

Types

type Result

type Result struct {
	Errno int32  `json:"code"`
	Desc  string `json:"msg"`
}

Result

func Error

func Error(code int32, err string) Result

func Succeed

func Succeed() Result

func WithErr

func WithErr(err error) Result

func (Result) Equal

func (r Result) Equal(code int32) bool

func (Result) Error

func (r Result) Error() string

error interface

func (Result) FPrint

func (r Result) FPrint(model string, o interface{}) Result

func (Result) NonFound

func (r Result) NonFound() bool

* 不是NOT FOUND的错误

func (Result) NotFound

func (r Result) NotFound() bool

func (Result) Ok

func (r Result) Ok() bool

func (Result) Print

func (r Result) Print() Result

Jump to

Keyboard shortcuts

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