Documentation ¶
Index ¶
- Variables
- func Code(err error) int
- func ErrHandle(err interface{}) error
- type ErrCode
- func (x ErrCode) Code() int
- func (ErrCode) Descriptor() protoreflect.EnumDescriptor
- func (x ErrCode) Enum() *ErrCode
- func (ErrCode) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrCode) ErrRep() *ErrRep
- func (x ErrCode) Error() string
- func (x ErrCode) GrpcStatus() *status.Status
- func (x ErrCode) MarshalGQL(w io.Writer)
- func (x ErrCode) MarshalJSON() ([]byte, error)
- func (x ErrCode) Message(msg string) *ErrRep
- func (x ErrCode) Number() protoreflect.EnumNumber
- func (x ErrCode) OriErrRep() *errorsi.ErrRep
- func (x ErrCode) OriLog(err error) *errorsi.ErrRep
- func (x ErrCode) OriMessage(msg string) *errorsi.ErrRep
- func (x ErrCode) OriWarp(err error) *errorsi.ErrRep
- func (x ErrCode) OrigString() string
- func (x ErrCode) Origin() errorsi.ErrCode
- func (x ErrCode) Rep() *ErrRep
- func (x ErrCode) String() string
- func (ErrCode) Type() protoreflect.EnumType
- func (x *ErrCode) UnmarshalGQL(v interface{}) error
- func (x *ErrCode) UnmarshalJSON(data []byte) error
- func (x ErrCode) Warp(err error) *ErrRep
- type ErrCodeGeneric
- type ErrCodeInterface
- type ErrRep
- func (*ErrRep) Descriptor() ([]byte, []int)deprecated
- func (x *ErrRep) Error() string
- func (x *ErrRep) GetCode() ErrCode
- func (x *ErrRep) GetMessage() string
- func (x *ErrRep) GrpcStatus() *status.Status
- func (x *ErrRep) MarshalJSON() ([]byte, error)
- func (*ErrRep) ProtoMessage()
- func (x *ErrRep) ProtoReflect() protoreflect.Message
- func (x *ErrRep) Reset()
- func (x *ErrRep) String() string
- type ErrRepInterface
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrCode_name = map[int32]string{ 0: "Success", 1: "Canceled", 2: "Unknown", 3: "InvalidArgument", 4: "DeadlineExceeded", 5: "NotFound", 6: "AlreadyExists", 7: "PermissionDenied", 8: "ResourceExhausted", 9: "FailedPrecondition", 10: "Aborted", 11: "OutOfRange", 12: "Unimplemented", 13: "Internal", 14: "Unavailable", 15: "DataLoss", 16: "Unauthenticated", 10000: "SysError", 21000: "DBError", 21001: "RowExists", 22000: "RedisErr", 30000: "IOError", 30001: "UploadFail", 30002: "UploadCheckFail", 30003: "UploadCheckFormat", 30004: "TimeTooMuch", 30005: "ParamInvalid", } ErrCode_value = map[string]int32{ "Success": 0, "Canceled": 1, "Unknown": 2, "InvalidArgument": 3, "DeadlineExceeded": 4, "NotFound": 5, "AlreadyExists": 6, "PermissionDenied": 7, "ResourceExhausted": 8, "FailedPrecondition": 9, "Aborted": 10, "OutOfRange": 11, "Unimplemented": 12, "Internal": 13, "Unavailable": 14, "DataLoss": 15, "Unauthenticated": 16, "SysError": 10000, "DBError": 21000, "RowExists": 21001, "RedisErr": 22000, "IOError": 30000, "UploadFail": 30001, "UploadCheckFail": 30002, "UploadCheckFormat": 30003, "TimeTooMuch": 30004, "ParamInvalid": 30005, } )
Enum value maps for ErrCode.
View Source
var File_cherry_protobuf_errorcode_enum_proto protoreflect.FileDescriptor
View Source
var File_cherry_protobuf_errorcode_errrep_proto protoreflect.FileDescriptor
Functions ¶
Types ¶
type ErrCode ¶
type ErrCode int32
const ( Success ErrCode = 0 Canceled ErrCode = 1 Unknown ErrCode = 2 InvalidArgument ErrCode = 3 DeadlineExceeded ErrCode = 4 NotFound ErrCode = 5 AlreadyExists ErrCode = 6 PermissionDenied ErrCode = 7 ResourceExhausted ErrCode = 8 FailedPrecondition ErrCode = 9 Aborted ErrCode = 10 OutOfRange ErrCode = 11 Unimplemented ErrCode = 12 Internal ErrCode = 13 DataLoss ErrCode = 15 Unauthenticated ErrCode = 16 SysError ErrCode = 10000 DBError ErrCode = 21000 RowExists ErrCode = 21001 RedisErr ErrCode = 22000 IOError ErrCode = 30000 UploadFail ErrCode = 30001 UploadCheckFail ErrCode = 30002 UploadCheckFormat ErrCode = 30003 TimeTooMuch ErrCode = 30004 ParamInvalid ErrCode = 30005 )
func (ErrCode) Descriptor ¶
func (ErrCode) Descriptor() protoreflect.EnumDescriptor
func (ErrCode) EnumDescriptor
deprecated
func (ErrCode) GrpcStatus ¶ added in v1.2.12
example 实现
func (ErrCode) MarshalGQL ¶
func (ErrCode) MarshalJSON ¶ added in v1.6.0
func (ErrCode) Number ¶
func (x ErrCode) Number() protoreflect.EnumNumber
func (ErrCode) OrigString ¶
func (ErrCode) Type ¶
func (ErrCode) Type() protoreflect.EnumType
func (*ErrCode) UnmarshalGQL ¶
func (*ErrCode) UnmarshalJSON ¶ added in v1.6.0
type ErrCodeGeneric ¶
type ErrCodeInterface ¶
type ErrCodeInterface interface { }
type ErrRep ¶
type ErrRep struct { Code ErrCode `protobuf:"varint,1,opt,name=code,proto3,enum=errorcode.ErrCode" json:"code"` Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"` // contains filtered or unexported fields }
func NewErrRep ¶ added in v1.6.0
func NewErrRep[E ErrCodeGeneric](code E, msg string) *ErrRep
func SuccessRep ¶ added in v1.6.0
func SuccessRep() *ErrRep
func (*ErrRep) Descriptor
deprecated
func (*ErrRep) GetMessage ¶
func (*ErrRep) GrpcStatus ¶ added in v1.2.12
func (*ErrRep) MarshalJSON ¶
func (*ErrRep) ProtoMessage ¶
func (*ErrRep) ProtoMessage()
func (*ErrRep) ProtoReflect ¶
func (x *ErrRep) ProtoReflect() protoreflect.Message
type ErrRepInterface ¶
type ErrRepInterface interface {
ErrRep() *ErrRep
}
Click to show internal directories.
Click to hide internal directories.