codes

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodeName

func GetCodeName(code Code) string

Types

type Code

type Code int32

通用错误码定义(0-100)

const (
	OK                    Code = 0
	Unknown               Code = 1  // 未知错误
	Canceled              Code = 2  // 操作被取消
	Aborted               Code = 3  // 操作被终止
	Unavailable           Code = 4  // 服务不可用
	DeadlineExceeded      Code = 5  // 过期超时
	InvalidArgument       Code = 6  // 参数错误
	OutOfRange            Code = 7  // 请求数据超出限制
	RequestTimeout        Code = 8  // 请求超时
	BadRequest            Code = 9  // 错误的请求
	NotFound              Code = 10 // 请求资源未找到
	PermissionDenied      Code = 11 // 权限不足
	Unauthenticated       Code = 12 // 未认证
	ResourceExhausted     Code = 13 // 资源已耗尽
	NotImplemented        Code = 14 // 请求未实现
	AlreadyExists         Code = 15 // entity已经存在
	OperationNotSupported Code = 16 // 不支持的操作
	OperationTooFrequent  Code = 17 // 操作过于频繁
	TransportFailure      Code = 18 // 传输错误
	DataLoss              Code = 19 // unrecoverable data loss or corruption
	DatabaseError         Code = 20 // 数据库异常
	RuntimeException      Code = 21 // 运行时错误
	ServiceMaintenance    Code = 22 // 服务维护中
	InternalError         Code = 23 // 内部错误
)

func GetCodeValue

func GetCodeValue(name string) Code

func (Code) String

func (c Code) String() string

Jump to

Keyboard shortcuts

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