codes

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package codes provide codes list

Index

Constants

View Source
const (
	OK uint32 = 0

	Canceled          uint32 = 10001
	Unknown           uint32 = 10002
	InvalidArgument   uint32 = 10003
	DeadlineExceeded  uint32 = 10004
	NotFound          uint32 = 10005
	AlreadyExists     uint32 = 10006
	PermissionDenied  uint32 = 10007
	ResourceExhausted uint32 = 10008
	Aborted           uint32 = 10010
	Unimplemented     uint32 = 10012
	Internal          uint32 = 10013
	Unavailable       uint32 = 10014
	Unauthenticated   uint32 = 10016

	ConfigurationError uint32 = 10101
	DBError            uint32 = 10102

	ContentIllegal uint32 = 10201
	ImageIllegal   uint32 = 10202
	VideoIllegal   uint32 = 10203
)

Code define

Variables

This section is empty.

Functions

func CodeAbstract

func CodeAbstract(code uint32) string

CodeAbstract codes memo

func CodeToGRPC

func CodeToGRPC(code uint32) codes.Code

CodeToGRPC convert int codes to codes.Code

func CodeToStatus

func CodeToStatus(code uint32) int

CodeToStatus codes to http status

func Default

func Default() lang.Lang

Default Lang, config by cfgkey.GlobalLang

func GRPCToCode

func GRPCToCode(code codes.Code) uint32

GRPCToCode convert grpc codes to int codes

Types

This section is empty.

Jump to

Keyboard shortcuts

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