errcode

package
v0.0.32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2024 License: MIT Imports: 14 Imported by: 13

Documentation

Index

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_hopeio_errcode_errcode_proto protoreflect.FileDescriptor

Functions

func HttpStatusFromCode added in v0.0.9

func HttpStatusFromCode(code ErrCode) int

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
	Unavailable        ErrCode = 14
	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) Code

func (x ErrCode) Code() int

func (ErrCode) Descriptor

func (ErrCode) Descriptor() protoreflect.EnumDescriptor

func (ErrCode) Enum

func (x ErrCode) Enum() *ErrCode

func (ErrCode) EnumDescriptor deprecated

func (ErrCode) EnumDescriptor() ([]byte, []int)

Deprecated: Use ErrCode.Descriptor instead.

func (ErrCode) ErrRep

func (x ErrCode) ErrRep() *errcode.ErrRep

func (ErrCode) Error

func (x ErrCode) Error() string

func (ErrCode) GRPCStatus added in v0.0.24

func (x ErrCode) GRPCStatus() *status.Status

example 实现

func (ErrCode) MarshalGQL

func (x ErrCode) MarshalGQL(w io.Writer)

func (ErrCode) Msg added in v0.0.24

func (x ErrCode) Msg(msg string) *errcode.ErrRep

func (ErrCode) Number

func (x ErrCode) Number() protoreflect.EnumNumber

func (ErrCode) OrigString

func (x ErrCode) OrigString() string

func (ErrCode) Origin

func (x ErrCode) Origin() errcode.ErrCode

func (ErrCode) String

func (x ErrCode) String() string

func (ErrCode) Type

func (ErrCode) Type() protoreflect.EnumType

func (*ErrCode) UnmarshalGQL

func (x *ErrCode) UnmarshalGQL(v interface{}) error

func (ErrCode) Wrap added in v0.0.23

func (x ErrCode) Wrap(err error) *errcode.ErrRep

type ErrCodeGeneric

type ErrCodeGeneric interface {
	~int | ~int32 | ~int64 | ~uint | ~uint32 | ~uint64
}

type ErrCodeInterface

type ErrCodeInterface interface {
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL