Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Success = NewError(0, "成功") ServerError = NewError(10000, "服务内部错误") InvalidParams = NewError(10001, "入参错误") NotFound = NewError(10002, "找不到") TooManyRequests = NewError(10008, "请求过多") GatewayMethodsLimit = NewError(10109, "网关仅接受GET或POST请求") GatewayLostSign = NewError(10110, "网关请求缺少签名") GatewayLostAppKey = NewError(10111, "网关请求缺少APP KEY") GatewayAppKeyInvalid = NewError(10112, "网关请求无效APP KEY") GatewayAppKeyClosed = NewError(10113, "网关请求APP KEY已停用") GatewayParamSignError = NewError(10114, "网关请求参数签名错误") GatewayTooManyRequests = NewError(10115, "网关请求频次超限") )
Functions ¶
func HttpStatusCode ¶
func HttpStatusCode(e mir.Error) int
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) StatusCode ¶
func (*Error) WithDetails ¶
type ValidError ¶
type ValidError struct {
Message string
}
func (*ValidError) Error ¶
func (v *ValidError) Error() string
type ValidErrors ¶
type ValidErrors []*ValidError
func (ValidErrors) Error ¶
func (v ValidErrors) Error() string
func (ValidErrors) Errors ¶
func (v ValidErrors) Errors() []string
Click to show internal directories.
Click to hide internal directories.