grpcErrProtobuf

package
v0.0.0-...-bff8ed8 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthErrDetail        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowErrDetail          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupErrDetail = fmt.Errorf("proto: unexpected end of group")
)
View Source
var E_Code = &proto.ExtensionDesc{
	ExtendedType:  (*descriptorpb.EnumValueOptions)(nil),
	ExtensionType: (*int32)(nil),
	Field:         1109,
	Name:          "proto.code",
	Tag:           "varint,1109,opt,name=code",
	Filename:      "07_grpc_error/proto/err.proto",
}
View Source
var E_DefaultCode = &proto.ExtensionDesc{
	ExtendedType:  (*descriptorpb.EnumOptions)(nil),
	ExtensionType: (*int32)(nil),
	Field:         1108,
	Name:          "proto.default_code",
	Tag:           "varint,1108,opt,name=default_code",
	Filename:      "07_grpc_error/proto/err.proto",
}
View Source
var Error_name = map[int32]string{
	0:   "RESOURCE_ERR_UNKNOWN",
	101: "RESOURCE_ERR_NOT_FOUND",
	102: "RESOURCE_ERR_LIST_MYSQL",
	103: "RESOURCE_ERR_INFO_MYSQL",
}
View Source
var Error_value = map[string]int32{
	"RESOURCE_ERR_UNKNOWN":    0,
	"RESOURCE_ERR_NOT_FOUND":  101,
	"RESOURCE_ERR_LIST_MYSQL": 102,
	"RESOURCE_ERR_INFO_MYSQL": 103,
}

Functions

This section is empty.

Types

type ErrDetail

type ErrDetail struct {
	Key                  string   `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"`
	Msg                  string   `protobuf:"bytes,2,opt,name=msg,proto3" json:"msg,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*ErrDetail) Descriptor

func (*ErrDetail) Descriptor() ([]byte, []int)

func (*ErrDetail) GetKey

func (m *ErrDetail) GetKey() string

func (*ErrDetail) GetMsg

func (m *ErrDetail) GetMsg() string

func (*ErrDetail) Marshal

func (m *ErrDetail) Marshal() (dAtA []byte, err error)

func (*ErrDetail) MarshalTo

func (m *ErrDetail) MarshalTo(dAtA []byte) (int, error)

func (*ErrDetail) MarshalToSizedBuffer

func (m *ErrDetail) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*ErrDetail) ProtoMessage

func (*ErrDetail) ProtoMessage()

func (*ErrDetail) Reset

func (m *ErrDetail) Reset()

func (*ErrDetail) Size

func (m *ErrDetail) Size() (n int)

func (*ErrDetail) String

func (m *ErrDetail) String() string

func (*ErrDetail) Unmarshal

func (m *ErrDetail) Unmarshal(dAtA []byte) error

func (*ErrDetail) XXX_DiscardUnknown

func (m *ErrDetail) XXX_DiscardUnknown()

func (*ErrDetail) XXX_Marshal

func (m *ErrDetail) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*ErrDetail) XXX_Merge

func (m *ErrDetail) XXX_Merge(src proto.Message)

func (*ErrDetail) XXX_Size

func (m *ErrDetail) XXX_Size() int

func (*ErrDetail) XXX_Unmarshal

func (m *ErrDetail) XXX_Unmarshal(b []byte) error

type Error

type Error int32

@plugins=protoc-gen-go-errors 错误

const (
	// 未知类型
	// @code=UNKNOWN
	Error_RESOURCE_ERR_UNKNOWN Error = 0
	// 找不到资源
	// @code=NOT_FOUND
	Error_RESOURCE_ERR_NOT_FOUND Error = 101
	// 获取列表数据出错
	// @code=INTERNAL
	Error_RESOURCE_ERR_LIST_MYSQL Error = 102
	// 获取详情数据出错
	// @code=INTERNAL
	Error_RESOURCE_ERR_INFO_MYSQL Error = 103
)

func (Error) EnumDescriptor

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

func (Error) String

func (x Error) String() string

Jump to

Keyboard shortcuts

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