errorv1

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ERROR_name = map[int32]string{
		0:         "UNKNOWN",
		100000001: "CONTENT_MISSING",
		100000002: "CONTENT_ERROR",
	}
	ERROR_value = map[string]int32{
		"UNKNOWN":         0,
		"CONTENT_MISSING": 100000001,
		"CONTENT_ERROR":   100000002,
	}
)

Enum value maps for ERROR.

View Source
var ERROR_http_code = map[string]int{

	"UNKNOWN":         500,
	"CONTENT_MISSING": 400,
	"CONTENT_ERROR":   400,
}
View Source
var File_api_test_service_v1_errors_test_error_v1_proto protoreflect.FileDescriptor

Functions

func DefaultErrorContentError

func DefaultErrorContentError() *errors.Error

内容不正确

func DefaultErrorContentMissing

func DefaultErrorContentMissing() *errors.Error

内容不能为空

func DefaultErrorUnknown

func DefaultErrorUnknown() *errors.Error

未知错误

func ErrorContentError

func ErrorContentError(format string, args ...interface{}) *errors.Error

内容不正确

func ErrorContentMissing

func ErrorContentMissing(format string, args ...interface{}) *errors.Error

内容不能为空

func ErrorUnknown

func ErrorUnknown(format string, args ...interface{}) *errors.Error

未知错误

func IsContentError

func IsContentError(err error) bool

内容不正确

func IsContentMissing

func IsContentMissing(err error) bool

内容不能为空

func IsUnknown

func IsUnknown(err error) bool

未知错误

Types

type ERROR

type ERROR int32

ERROR .

const (
	// 未知错误
	ERROR_UNKNOWN ERROR = 0
	// 内容不能为空
	ERROR_CONTENT_MISSING ERROR = 100000001
	// 内容不正确
	ERROR_CONTENT_ERROR ERROR = 100000002
)

func (ERROR) Descriptor

func (ERROR) Descriptor() protoreflect.EnumDescriptor

func (ERROR) Enum

func (x ERROR) Enum() *ERROR

func (ERROR) EnumDescriptor deprecated

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

Deprecated: Use ERROR.Descriptor instead.

func (ERROR) HTTPCode

func (x ERROR) HTTPCode() int

func (ERROR) Number

func (x ERROR) Number() protoreflect.EnumNumber

func (ERROR) String

func (x ERROR) String() string

func (ERROR) Type

func (ERROR) Type() protoreflect.EnumType

Jump to

Keyboard shortcuts

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