Documentation
¶
Index ¶
- func Convert(err error) *status.Status
- func Err2GrpcCode(err error) codes.Code
- func GrpcCodeToHTTP(statusCode codes.Code) int
- func Http2GrpcCode(code int32) codes.Code
- func IsGrpcAcceptable(err error) bool
- func IsMemoryErr(err error) bool
- type Error
- func (e *Error) As(target interface{}) bool
- func (e *Error) Ctx(ctx context.Context) *Error
- func (e *Error) Err(err error) *Error
- func (e *Error) Error() string
- func (e *Error) GRPCStatus() *status.Status
- func (e *Error) HTTPStatus() int
- func (e *Error) Is(err error) bool
- func (e *Error) Msg(msg string, args ...interface{}) *Error
- func (e *Error) Status(code codes.Code) *Error
- func (e *Error) StatusAborted() error
- func (e *Error) StatusAlreadyExists() error
- func (e *Error) StatusBadRequest() error
- func (e *Error) StatusCancelled() error
- func (e *Error) StatusConflict() error
- func (e *Error) StatusDataLoss() error
- func (e *Error) StatusDeadlineExceeded() error
- func (e *Error) StatusFailedPrecondition() error
- func (e *Error) StatusForbidden() error
- func (e *Error) StatusInternal() error
- func (e *Error) StatusInvalidArgument() error
- func (e *Error) StatusNotFound() error
- func (e *Error) StatusOutOfRange() error
- func (e *Error) StatusPermissionDenied() error
- func (e *Error) StatusResourceExhausted() error
- func (e *Error) StatusTimeout() error
- func (e *Error) StatusUnauthorized() error
- func (e *Error) StatusUnavailable() error
- func (e *Error) StatusUnimplemented() error
- func (e *Error) StatusUnknown() error
- func (e *Error) Tag(k, v string) *Error
- func (e *Error) TraceId(traceId string) *Error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Err2GrpcCode ¶
Err2GrpcCode converts a standard Go error into its canonical code. Note that this is only used to translate the error returned by the server applications.
func Http2GrpcCode ¶
func IsGrpcAcceptable ¶
func IsMemoryErr ¶
Types ¶
type Error ¶
type Error struct {
// contains filtered or unexported fields
}
func (*Error) GRPCStatus ¶ added in v0.1.16
GRPCStatus 实现grpc status的GRPCStatus接口
func (*Error) HTTPStatus ¶
HTTPStatus returns the Status represented by se.
func (*Error) StatusAborted ¶
func (*Error) StatusAlreadyExists ¶
func (*Error) StatusBadRequest ¶
func (*Error) StatusCancelled ¶
func (*Error) StatusConflict ¶
func (*Error) StatusDataLoss ¶
func (*Error) StatusDeadlineExceeded ¶
func (*Error) StatusFailedPrecondition ¶
func (*Error) StatusForbidden ¶
func (*Error) StatusInternal ¶
func (*Error) StatusInvalidArgument ¶
func (*Error) StatusNotFound ¶
func (*Error) StatusOutOfRange ¶
func (*Error) StatusPermissionDenied ¶
func (*Error) StatusResourceExhausted ¶
func (*Error) StatusTimeout ¶
func (*Error) StatusUnauthorized ¶
func (*Error) StatusUnavailable ¶
func (*Error) StatusUnimplemented ¶
func (*Error) StatusUnknown ¶
Click to show internal directories.
Click to hide internal directories.