Documentation ¶
Overview ¶
Package response 提供统一的 JSON 返回结构,可以通过配置设置具体返回的 code 字段为 int 或者 string
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( CodeSuccess = goutils.NewErrCode(success, gettext.Gettext("成功")) CodeFailure = goutils.NewErrCode(failure, gettext.Gettext("失败")) CodeInvalidParam = goutils.NewErrCode(invalidParam, gettext.Gettext("参数错误")) CodeNotFound = goutils.NewErrCode(notFound, gettext.Gettext("未找到")) CodeInternalError = goutils.NewErrCode(unknownError, gettext.Gettext("未知错误")) )
错误码对象定义
Functions ¶
func IsInvalidParamError ¶
IsInvalidParamError 判断错误信息中是否包含:参数错误
Types ¶
Click to show internal directories.
Click to hide internal directories.