Documentation
¶
Index ¶
- Variables
- func Failed(c *gin.Context, err error)
- func FailedWithMsg(c *gin.Context, msg string, err error)
- func HTTP400(ctx *gin.Context, err error)
- func HTTP403(ctx *gin.Context, err error)
- func HTTP404(ctx *gin.Context, err error)
- func HTTP500(ctx *gin.Context, err error)
- func HTTPFail(ctx *gin.Context, err error)
- func HTTPFailWithData(ctx *gin.Context, err error, data interface{})
- func HTTPFailWithStatus(ctx *gin.Context, err error, httpStatus int)
- func HTTPOutsideSuccessWithData(ctx *gin.Context, data interface{})
- func HTTPSuccess(ctx *gin.Context)
- func HTTPSuccessWithData(ctx *gin.Context, data interface{})
- func HTTPSuccessWithSting(ctx *gin.Context, data string)
- func SetErrPrintfMsg(err *Error, v ...interface{})
- func Success(c *gin.Context, data interface{})
- func SuccessWithMsg(c *gin.Context, msg string, data interface{})
- func WriteResponse(c *gin.Context, err error, data interface{})
- type Error
- func (err Error) Equal(e error) bool
- func (err Error) Error() string
- func (err Error) Sprintf(v ...interface{}) Error
- func (err Error) WithArgs(args ...interface{}) Error
- func (err Error) Wrap(core error) error
- func (err Error) WrapPrint(core error, message string, user ...interface{}) error
- func (err Error) WrapPrintf(core error, format string, message ...interface{}) error
- type HTTPRes
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrorDBDelete = Error{
Code: 110104,
Msg: "删除错误",
}
View Source
var ErrorDBFound = Error{
Code: 110106,
Msg: "记录已存在",
}
View Source
var ErrorDBInsert = Error{
Code: 110102,
Msg: "新建错误",
}
View Source
var ErrorDBNotFound = Error{
Code: 110105,
Msg: "记录不存在",
}
View Source
var ErrorDBQuery = Error{
Code: 110101,
Msg: "查询错误",
}
View Source
var ErrorDBUpdate = Error{
Code: 110103,
Msg: "更新错误",
}
View Source
var ErrorGinTimeoutError = Error{
Code: 100003,
Msg: "Gin timeout error",
}
View Source
var ErrorJsonMarshalError = Error{
Code: 100004,
Msg: "json marshal error",
}
View Source
var ErrorJsonUnMarshalError = Error{
Code: 100005,
Msg: "json unmarshal error",
}
View Source
var ErrorParamInvalid = Error{
Code: 100001,
Msg: "param error",
}
View Source
var ErrorSysInnerError = Error{
Code: 100002,
Msg: "system inner error",
}
Functions ¶
func HTTPFailWithData ¶
HTTPFailWithData 业务失败带Data
func HTTPSuccessWithData ¶
HTTPSuccessWithData 业务成功返回
func HTTPSuccessWithSting ¶
func SetErrPrintfMsg ¶
func SetErrPrintfMsg(err *Error, v ...interface{})
func SuccessWithMsg ¶
func WriteResponse ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.