Documentation ¶ Index ¶ type Err func NewUserError(state int, msg string) *Err func (e Err) Error() string func (e Err) Result() Result func (e Err) String() string type Result Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ This section is empty. Types ¶ type Err ¶ type Err struct { State int //异常的状态码, 0:无异常 Data interface{} //异常相关的参数 Message string //消息 Pkg string Module string //异常的模块 Err error //被wrap的异常 UserError bool //是否是用户异常,否则是系统异常 } func NewUserError ¶ func NewUserError(state int, msg string) *Err func (Err) Error ¶ func (e Err) Error() string func (Err) Result ¶ func (e Err) Result() Result func (Err) String ¶ func (e Err) String() string type Result ¶ type Result struct { State int Data interface{} `json:"Data,omitempty"` Message string `json:"Message,omitempty"` Pkg string `json:"Pkg,omitempty"` Module string `json:"Module,omitempty"` } Source Files ¶ View all Source files errors.go Click to show internal directories. Click to hide internal directories.