Documentation
¶
Index ¶
- Variables
- func GetErrxField[T any](err any, key DetailKey) (result T)
- func Map2Pb(val any) (m map[string]*Value)
- func New(msg string, sets ...func(map[DetailKey]any)) error
- func NewFromStatus(s *status.Status) error
- func NewWithSkip(msg string, skip int, sets ...func(map[DetailKey]any)) error
- func PbList2SliceAny(pbList *List) (s []any)
- func PbMap2MapStrAny(pbMap *Map) (m map[string]any)
- func PbValue2Any(pbValue *Value) (v any)
- func PrintGrpcStatusErrorDetail(err error)
- func WithCode(code int) func(map[DetailKey]any)
- func Wrap(err error, msg string, sets ...func(map[DetailKey]any)) error
- func WrapWithSkip(err error, message string, skip int, sets ...func(map[DetailKey]any)) error
- type DetailKey
- type Errx
- type Fields
- type List
- type Map
- type Value
- func (*Value) Descriptor() ([]byte, []int)deprecated
- func (x *Value) GetInt32Val() int32
- func (x *Value) GetInt64Val() int64
- func (m *Value) GetKind() isValue_Kind
- func (x *Value) GetListVal() *List
- func (x *Value) GetMapVal() *Map
- func (x *Value) GetStrVal() string
- func (*Value) ProtoMessage()
- func (x *Value) ProtoReflect() protoreflect.Message
- func (x *Value) Reset()
- func (x *Value) String() string
- type Value_Int32Val
- type Value_Int64Val
- type Value_ListVal
- type Value_MapVal
- type Value_StrVal
Constants ¶
This section is empty.
Variables ¶
View Source
var File_error_proto protoreflect.FileDescriptor
Functions ¶
func GetErrxField ¶
func NewFromStatus ¶
NewFromStatus new an error from status.Status
func PbList2SliceAny ¶
func PbMap2MapStrAny ¶
func PbValue2Any ¶
func PrintGrpcStatusErrorDetail ¶
func PrintGrpcStatusErrorDetail(err error)
PrintGrpcStatusErrorDetail 打印err的详细信息
Types ¶
type Errx ¶
func (Errx) GRPCStatus ¶
type List ¶
type List struct { List []*Value `protobuf:"bytes,1,rep,name=List,proto3" json:"List,omitempty"` // contains filtered or unexported fields }
func (*List) Descriptor
deprecated
func (*List) ProtoMessage ¶
func (*List) ProtoMessage()
func (*List) ProtoReflect ¶
func (x *List) ProtoReflect() protoreflect.Message
type Map ¶
type Map struct { Fields map[string]*Value `` /* 153-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Map) Descriptor
deprecated
func (*Map) ProtoMessage ¶
func (*Map) ProtoMessage()
func (*Map) ProtoReflect ¶
func (x *Map) ProtoReflect() protoreflect.Message
type Value ¶
type Value struct { // Types that are assignable to Kind: // // *Value_Int32Val // *Value_Int64Val // *Value_StrVal // *Value_MapVal // *Value_ListVal Kind isValue_Kind `protobuf_oneof:"Kind"` // contains filtered or unexported fields }
func Any2PbValue ¶
func (*Value) Descriptor
deprecated
func (*Value) GetInt32Val ¶
func (*Value) GetInt64Val ¶
func (*Value) GetListVal ¶
func (*Value) ProtoMessage ¶
func (*Value) ProtoMessage()
func (*Value) ProtoReflect ¶
func (x *Value) ProtoReflect() protoreflect.Message
type Value_Int32Val ¶
type Value_Int32Val struct {
Int32Val int32 `protobuf:"varint,1,opt,name=Int32Val,proto3,oneof"`
}
type Value_Int64Val ¶
type Value_Int64Val struct {
Int64Val int64 `protobuf:"varint,2,opt,name=Int64Val,proto3,oneof"`
}
type Value_ListVal ¶
type Value_ListVal struct {
ListVal *List `protobuf:"bytes,5,opt,name=ListVal,proto3,oneof"`
}
type Value_MapVal ¶
type Value_MapVal struct {
MapVal *Map `protobuf:"bytes,4,opt,name=MapVal,proto3,oneof"`
}
type Value_StrVal ¶
type Value_StrVal struct {
StrVal string `protobuf:"bytes,3,opt,name=StrVal,proto3,oneof"`
}
Click to show internal directories.
Click to hide internal directories.