Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrOK = ErrPack{2000, "success"} ErrUnknown = ErrPack{5900, "unknown error"} ErrNotLogin = ErrPack{4001, "user not logged in error"} ErrNoPermission = ErrPack{4002, "no permission error"} ErrInputHeader = ErrPack{4003, "input header error"} ErrInputBody = ErrPack{4004, "input body error"} ErrParseToken = ErrPack{5201, "parse token error"} ErrServiceConn = ErrPack{5301, "service communication error"} ErrLogic = ErrPack{5501, "logical error"} ErrCacheConn = ErrPack{5601, "cache connection error"} ErrNoCache = ErrPack{5602, "no cache error"} ErrDBConn = ErrPack{5701, "database connection error"} ErrNoRecord = ErrPack{5702, "database no record error"} ErrDuplicatedRecord = ErrPack{5703, "database duplicated record error"} ErrTypeConv = ErrPack{5901, "type conversion error"} ErrGenJWT = ErrPack{5903, "generate JWT error"} ErrParseJWT = ErrPack{5903, "parse JWT error"} )
Functions ¶
This section is empty.
Types ¶
type ErrPack ¶
type Packer ¶
type Packer struct {
V interface{}
}
func (*Packer) PackWithError ¶
PackWithError will do the pack and additionally log the error with Error level
func (*Packer) PackWithInfo ¶
PackWithInfo will do the pack and additionally log the error with INFO level
func (*Packer) PackWithWarn ¶
PackWithWarn will do the pack and additionally log the error with WARN level
Click to show internal directories.
Click to hide internal directories.