Documentation ¶
Index ¶
Constants ¶
View Source
const (
UnknownCode = 2
)
Variables ¶
View Source
var ( OK = New(0, "请求正常") Canceled = New(1, "操作取消") Unknown = New(2, "未知错误") InvalidArgument = New(3, "无效参数") DeadlineExceeded = New(4, "处理时间超过最后期限") NotFound = New(5, "访问链接不存在") AlreadyExists = New(6, "目标已存在") PermissionDenied = New(7, "权限不足") ResourceExhausted = New(8, "资源耗尽") FailedPrecondition = New(9, "前置条件出错") Aborted = New(10, "操作中途失败") OutOfRange = New(11, "操作超出有效范围") Unimplemented = New(12, "当前服务未实现") Internal = New(13, "服务内部异常") DataLoss = New(15, "数据丢失") Unauthenticated = New(16, "未授权错误") )
Functions ¶
func ErrsFromGRPCCode ¶
StatusFromGRPCCode converts a gRPC error code into the corresponding Err code.
func GRPCCodeFromeErrs ¶
GRPCCodeFromStatus converts an Err code into the corresponding gRPC response status.
Types ¶
type Err ¶
type Err struct { Ecode int32 `json:"error"` Msg string `json:"msg"` Data interface{} `json:"data"` }
Err struct
func (*Err) GRPCStatus ¶
GRPCStatus returns the Status represented by se.
Click to show internal directories.
Click to hide internal directories.