Documentation
¶
Index ¶
Constants ¶
View Source
const ( Success = iota // UnKnownError 未知错误 UnKnownError // NotFound 未找到 NotFound // InvalidParam 无效参数 InvalidParameter // IllegalParam 非法参数 IllegalParam // InvalidAuthority 非法授权 InvalidAuthority // Unexpected 意外错误 Unexpected // Duplicated 重复 Duplicated // DatabaseError 数据库错误 DatabaseError // Timeout 超时 Timeout // NetworkError 网络错误 NetworkError Unauthorized // Forbidden 禁止访问 Forbidden // ResourceExhausted 资源耗尽 ResourceExhausted // TooManyRequests 请求过多 TooManyRequests ServiceUnavailable // NotImplemented 未实现 NotImplemented // BadGateway 网关错误 BadGateway // DataCorrupted 数据损坏 DataCorrupted // VersionConflict 版本冲突 VersionConflict // ExternalServiceError 外部服务错误 ExternalServiceError // InvalidOperation 无效操作 InvalidOperation // PermissionDenied 权限不足 PermissionDenied )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
Error *Error `json:"error"`
}
func NewSuccessResult ¶ added in v1.5.4
func NewSuccessResult() *Result
NewSuccessResult 创建一个成功的 Result(无错误)
type ResultWithError ¶ added in v1.5.4
type ResultWithError interface {
GetError() *Error
}
ResultWithError 表示包含错误的结果接口
Click to show internal directories.
Click to hide internal directories.