ehandle

package
v0.0.0-...-228285a Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2021 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfDefault    = ""
	ConfPrefix     = "Conf模块"
	ConfInitFailed = "初始化失败"
)

Variables

View Source
var (
	MySQLInvalidPassword      = errors.New("用户名或密码错误")
	MySQLUserExist            = errors.New("用户已存在")
	MySQLUserNotExist         = errors.New("用户不存在")
	MySQLCommunityIdNotExists = errors.New("社区id不存在")
	MySQLCommunityIdWrong     = errors.New("社区id有误")
)
View Source
var (
	RedisVoteTimeExpire = errors.New("超出投票时间")
	RedisReVote         = errors.New("重复投票")
)

Functions

This section is empty.

Types

type ConfError

type ConfError struct {
	Error   error
	Message string
}

func GetConfE

func GetConfE() *ConfError

func (*ConfError) HandInitFailed

func (e *ConfError) HandInitFailed()

func (*ConfError) Log

func (e *ConfError) Log()

func (*ConfError) Receive

func (e *ConfError) Receive(err error, msg string) *ConfError

type ControlError

type ControlError struct {
	Error   error
	CTX     *gin.Context
	Message ResCode
}

func GetControlE

func GetControlE() *ControlError

func (*ControlError) Hand

func (e *ControlError) Hand() *ControlError

func (*ControlError) Log

func (e *ControlError) Log() *ControlError

func (*ControlError) Receive

func (e *ControlError) Receive(c *gin.Context, err error, code ResCode) *ControlError

type ResCode

type ResCode int64
const (
	CodeInvalidParam ResCode = 1001 + iota
	CodeUserExist
	CodeUserNotExist
	CodeInvalidPassword
	CodeServerBusy
	CodeUserNoLogin
	CodePostNotExist
)

func (ResCode) Msg

func (c ResCode) Msg() string

type ResponseData

type ResponseData struct {
	Code ResCode     `json:"code"`
	Msg  interface{} `json:"msg"`
	Data interface{} `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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