Documentation ¶
Index ¶
- Variables
- func GetRWValue(rv protoreflect.Value, protoMsg protoreflect.ProtoMessage, name string) (reflect.Value, error)
- func NewDecodeError(key string, original error) error
- func PrepareInterfaceForDecode(where string, val reflect.Value, t reflect.Type) (reflect.Value, error)
- func PrepareInterfaceForEncode(where string, val reflect.Value, t reflect.Type) (reflect.Value, error)
- func PrepareValueForDecode(where string, val reflect.Value, t reflect.Type) (reflect.Value, error)
- func PrepareValueForEncode(where string, val reflect.Value, t reflect.Type) (reflect.Value, error)
- func ReflectIntoStd(sfv protoreflect.Value, useEnumNumbers bool) reflect.Type
- func ReflectToProtoValue(field reflect.Value) (protoreflect.Value, error)
- type DecodeError
- type Embed
- type EnumType
- type Msg
- func (*Msg) Descriptor() ([]byte, []int)deprecated
- func (x *Msg) GetA() string
- func (x *Msg) GetB() string
- func (x *Msg) GetC() *Embed
- func (x *Msg) GetEn() EnumType
- func (x *Msg) GetField() *Embed
- func (x *Msg) GetMapEnum() map[uint32]EnumType
- func (x *Msg) GetMapField() map[string]*Embed
- func (x *Msg) GetRepEnum() []EnumType
- func (x *Msg) GetRepField() []*Embed
- func (m *Msg) GetVariant() isMsg_Variant
- func (*Msg) ProtoMessage()
- func (x *Msg) ProtoReflect() protoreflect.Message
- func (x *Msg) Reset()
- func (x *Msg) String() string
- type Msg_A
- type Msg_B
- type Msg_C
- type WKT
- func (*WKT) Descriptor() ([]byte, []int)deprecated
- func (x *WKT) GetBoolField() *wrapperspb.BoolValue
- func (x *WKT) GetBytesField() *wrapperspb.BytesValue
- func (x *WKT) GetDoubleField() *wrapperspb.DoubleValue
- func (x *WKT) GetDurationField() *durationpb.Duration
- func (x *WKT) GetEmptyField() *emptypb.Empty
- func (x *WKT) GetFloatField() *wrapperspb.FloatValue
- func (x *WKT) GetInt32Field() *wrapperspb.Int32Value
- func (x *WKT) GetInt64Field() *wrapperspb.Int64Value
- func (x *WKT) GetRepBoolField() []*wrapperspb.BoolValue
- func (x *WKT) GetRepBytesField() []*wrapperspb.BytesValue
- func (x *WKT) GetRepDoubleField() []*wrapperspb.DoubleValue
- func (x *WKT) GetRepDurationField() []*durationpb.Duration
- func (x *WKT) GetRepEmptyField() []*emptypb.Empty
- func (x *WKT) GetRepFloatField() []*wrapperspb.FloatValue
- func (x *WKT) GetRepInt32Field() []*wrapperspb.Int32Value
- func (x *WKT) GetRepInt64Field() []*wrapperspb.Int64Value
- func (x *WKT) GetRepStringField() []*wrapperspb.StringValue
- func (x *WKT) GetRepStructField() []*structpb.Struct
- func (x *WKT) GetRepTimestampField() []*timestamppb.Timestamp
- func (x *WKT) GetRepUInt32Field() []*wrapperspb.UInt32Value
- func (x *WKT) GetRepUInt64Field() []*wrapperspb.UInt64Value
- func (x *WKT) GetRepValueField() []*structpb.Value
- func (x *WKT) GetStringField() *wrapperspb.StringValue
- func (x *WKT) GetStructField() *structpb.Struct
- func (x *WKT) GetTimestampField() *timestamppb.Timestamp
- func (x *WKT) GetUInt32Field() *wrapperspb.UInt32Value
- func (x *WKT) GetUInt64Field() *wrapperspb.UInt64Value
- func (x *WKT) GetValueField() *structpb.Value
- func (*WKT) ProtoMessage()
- func (x *WKT) ProtoReflect() protoreflect.Message
- func (x *WKT) Reset()
- func (x *WKT) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var ( EnumType_name = map[int32]string{ 0: "TEST", 1: "ANOTHER", } EnumType_value = map[string]int32{ "TEST": 0, "ANOTHER": 1, } )
Enum value maps for EnumType.
View Source
var ( TTime = reflect.TypeOf(time.Time{}) TProtoMessage = reflect.TypeOf((*protoreflect.ProtoMessage)(nil)).Elem() TProtoMap = reflect.TypeOf((*protoreflect.Map)(nil)).Elem() TProtoList = reflect.TypeOf((*protoreflect.List)(nil)).Elem() TProtoEnum = reflect.TypeOf((*protoreflect.Enum)(nil)).Elem() TProtoDuration = reflect.TypeOf(&durationpb.Duration{}) TProtoEmpty = reflect.TypeOf(&emptypb.Empty{}) TProtoTimestamp = reflect.TypeOf(×tamppb.Timestamp{}) TProtoStruct = reflect.TypeOf(&structpb.Struct{}) TProtoStructValue = reflect.TypeOf(&structpb.Value{}) TProtoStructListValue = reflect.TypeOf(&structpb.ListValue{}) TProtoWrappedString = reflect.TypeOf(&wrapperspb.StringValue{}) TProtoWrappedBytes = reflect.TypeOf(&wrapperspb.BytesValue{}) TProtoWrappedBool = reflect.TypeOf(&wrapperspb.BoolValue{}) TProtoWrappedUInt32 = reflect.TypeOf(&wrapperspb.UInt32Value{}) TProtoWrappedInt32 = reflect.TypeOf(&wrapperspb.Int32Value{}) TProtoWrappedUInt64 = reflect.TypeOf(&wrapperspb.UInt64Value{}) TProtoWrappedInt64 = reflect.TypeOf(&wrapperspb.Int64Value{}) TProtoWrappedFloat = reflect.TypeOf(&wrapperspb.FloatValue{}) TProtoWrappedDouble = reflect.TypeOf(&wrapperspb.DoubleValue{}) )
View Source
var ErrDirectSet = errors.New("field should be accessed directly")
View Source
var File_test_proto protoreflect.FileDescriptor
Functions ¶
func GetRWValue ¶
func GetRWValue( rv protoreflect.Value, protoMsg protoreflect.ProtoMessage, name string, ) (reflect.Value, error)
func NewDecodeError ¶
func PrepareValueForDecode ¶
func PrepareValueForEncode ¶
func ReflectIntoStd ¶
func ReflectIntoStd(sfv protoreflect.Value, useEnumNumbers bool) reflect.Type
func ReflectToProtoValue ¶
func ReflectToProtoValue( field reflect.Value, ) (protoreflect.Value, error)
Types ¶
type DecodeError ¶
type DecodeError struct {
// contains filtered or unexported fields
}
DecodeError represents an error that occurs when unmarshalling BSON bytes into a native Go type.
func (*DecodeError) Error ¶
func (de *DecodeError) Error() string
Error implements the error interface.
func (*DecodeError) Keys ¶
func (de *DecodeError) Keys() []string
Keys returns the BSON key path that caused an error as a slice of strings. The keys in the slice are in top-down order. For example, if the document being unmarshalled was {a: {b: {c: 1}}} and the value for c was supposed to be a string, the keys slice will be ["a", "b", "c"].
func (*DecodeError) Unwrap ¶
func (de *DecodeError) Unwrap() error
Unwrap returns the underlying error
type Embed ¶
type Embed struct { Text string `protobuf:"bytes,2,opt,name=Text,proto3" json:"Text,omitempty"` // contains filtered or unexported fields }
func (*Embed) Descriptor
deprecated
func (*Embed) ProtoMessage ¶
func (*Embed) ProtoMessage()
func (*Embed) ProtoReflect ¶
func (x *Embed) ProtoReflect() protoreflect.Message
type EnumType ¶
type EnumType int32
func (EnumType) Descriptor ¶
func (EnumType) Descriptor() protoreflect.EnumDescriptor
func (EnumType) EnumDescriptor
deprecated
func (EnumType) Number ¶
func (x EnumType) Number() protoreflect.EnumNumber
func (EnumType) Type ¶
func (EnumType) Type() protoreflect.EnumType
type Msg ¶
type Msg struct { Field *Embed `protobuf:"bytes,1,opt,name=Field,proto3" json:"Field,omitempty"` // Types that are assignable to Variant: // *Msg_A // *Msg_B // *Msg_C Variant isMsg_Variant `protobuf_oneof:"Variant"` MapField map[string]*Embed `` /* 158-byte string literal not displayed */ RepField []*Embed `protobuf:"bytes,20,rep,name=RepField,proto3" json:"RepField,omitempty"` En EnumType `protobuf:"varint,25,opt,name=En,proto3,enum=test.EnumType" json:"En,omitempty"` RepEnum []EnumType `protobuf:"varint,30,rep,packed,name=RepEnum,proto3,enum=test.EnumType" json:"RepEnum,omitempty"` MapEnum map[uint32]EnumType `` /* 177-byte string literal not displayed */ // contains filtered or unexported fields }
func (*Msg) Descriptor
deprecated
func (*Msg) GetMapEnum ¶
func (*Msg) GetMapField ¶
func (*Msg) GetRepEnum ¶
func (*Msg) GetRepField ¶
func (*Msg) GetVariant ¶
func (m *Msg) GetVariant() isMsg_Variant
func (*Msg) ProtoMessage ¶
func (*Msg) ProtoMessage()
func (*Msg) ProtoReflect ¶
func (x *Msg) ProtoReflect() protoreflect.Message
type WKT ¶
type WKT struct { EmptyField *emptypb.Empty `protobuf:"bytes,1,opt,name=EmptyField,proto3" json:"EmptyField,omitempty"` RepEmptyField []*emptypb.Empty `protobuf:"bytes,2,rep,name=RepEmptyField,proto3" json:"RepEmptyField,omitempty"` DurationField *durationpb.Duration `protobuf:"bytes,3,opt,name=DurationField,proto3" json:"DurationField,omitempty"` RepDurationField []*durationpb.Duration `protobuf:"bytes,4,rep,name=RepDurationField,proto3" json:"RepDurationField,omitempty"` TimestampField *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=TimestampField,proto3" json:"TimestampField,omitempty"` RepTimestampField []*timestamppb.Timestamp `protobuf:"bytes,6,rep,name=RepTimestampField,proto3" json:"RepTimestampField,omitempty"` StructField *structpb.Struct `protobuf:"bytes,7,opt,name=StructField,proto3" json:"StructField,omitempty"` RepStructField []*structpb.Struct `protobuf:"bytes,8,rep,name=RepStructField,proto3" json:"RepStructField,omitempty"` ValueField *structpb.Value `protobuf:"bytes,9,opt,name=ValueField,proto3" json:"ValueField,omitempty"` RepValueField []*structpb.Value `protobuf:"bytes,10,rep,name=RepValueField,proto3" json:"RepValueField,omitempty"` BoolField *wrapperspb.BoolValue `protobuf:"bytes,11,opt,name=BoolField,proto3" json:"BoolField,omitempty"` RepBoolField []*wrapperspb.BoolValue `protobuf:"bytes,12,rep,name=RepBoolField,proto3" json:"RepBoolField,omitempty"` BytesField *wrapperspb.BytesValue `protobuf:"bytes,13,opt,name=BytesField,proto3" json:"BytesField,omitempty"` RepBytesField []*wrapperspb.BytesValue `protobuf:"bytes,14,rep,name=RepBytesField,proto3" json:"RepBytesField,omitempty"` StringField *wrapperspb.StringValue `protobuf:"bytes,15,opt,name=StringField,proto3" json:"StringField,omitempty"` RepStringField []*wrapperspb.StringValue `protobuf:"bytes,16,rep,name=RepStringField,proto3" json:"RepStringField,omitempty"` Int32Field *wrapperspb.Int32Value `protobuf:"bytes,17,opt,name=Int32Field,proto3" json:"Int32Field,omitempty"` RepInt32Field []*wrapperspb.Int32Value `protobuf:"bytes,18,rep,name=RepInt32Field,proto3" json:"RepInt32Field,omitempty"` Int64Field *wrapperspb.Int64Value `protobuf:"bytes,19,opt,name=Int64Field,proto3" json:"Int64Field,omitempty"` RepInt64Field []*wrapperspb.Int64Value `protobuf:"bytes,20,rep,name=RepInt64Field,proto3" json:"RepInt64Field,omitempty"` UInt32Field *wrapperspb.UInt32Value `protobuf:"bytes,21,opt,name=UInt32Field,proto3" json:"UInt32Field,omitempty"` RepUInt32Field []*wrapperspb.UInt32Value `protobuf:"bytes,22,rep,name=RepUInt32Field,proto3" json:"RepUInt32Field,omitempty"` UInt64Field *wrapperspb.UInt64Value `protobuf:"bytes,23,opt,name=UInt64Field,proto3" json:"UInt64Field,omitempty"` RepUInt64Field []*wrapperspb.UInt64Value `protobuf:"bytes,24,rep,name=RepUInt64Field,proto3" json:"RepUInt64Field,omitempty"` FloatField *wrapperspb.FloatValue `protobuf:"bytes,25,opt,name=FloatField,proto3" json:"FloatField,omitempty"` RepFloatField []*wrapperspb.FloatValue `protobuf:"bytes,26,rep,name=RepFloatField,proto3" json:"RepFloatField,omitempty"` DoubleField *wrapperspb.DoubleValue `protobuf:"bytes,27,opt,name=DoubleField,proto3" json:"DoubleField,omitempty"` RepDoubleField []*wrapperspb.DoubleValue `protobuf:"bytes,28,rep,name=RepDoubleField,proto3" json:"RepDoubleField,omitempty"` // contains filtered or unexported fields }
func (*WKT) Descriptor
deprecated
func (*WKT) GetBoolField ¶
func (x *WKT) GetBoolField() *wrapperspb.BoolValue
func (*WKT) GetBytesField ¶
func (x *WKT) GetBytesField() *wrapperspb.BytesValue
func (*WKT) GetDoubleField ¶
func (x *WKT) GetDoubleField() *wrapperspb.DoubleValue
func (*WKT) GetDurationField ¶
func (x *WKT) GetDurationField() *durationpb.Duration
func (*WKT) GetEmptyField ¶
func (*WKT) GetFloatField ¶
func (x *WKT) GetFloatField() *wrapperspb.FloatValue
func (*WKT) GetInt32Field ¶
func (x *WKT) GetInt32Field() *wrapperspb.Int32Value
func (*WKT) GetInt64Field ¶
func (x *WKT) GetInt64Field() *wrapperspb.Int64Value
func (*WKT) GetRepBoolField ¶
func (x *WKT) GetRepBoolField() []*wrapperspb.BoolValue
func (*WKT) GetRepBytesField ¶
func (x *WKT) GetRepBytesField() []*wrapperspb.BytesValue
func (*WKT) GetRepDoubleField ¶
func (x *WKT) GetRepDoubleField() []*wrapperspb.DoubleValue
func (*WKT) GetRepDurationField ¶
func (x *WKT) GetRepDurationField() []*durationpb.Duration
func (*WKT) GetRepEmptyField ¶
func (*WKT) GetRepFloatField ¶
func (x *WKT) GetRepFloatField() []*wrapperspb.FloatValue
func (*WKT) GetRepInt32Field ¶
func (x *WKT) GetRepInt32Field() []*wrapperspb.Int32Value
func (*WKT) GetRepInt64Field ¶
func (x *WKT) GetRepInt64Field() []*wrapperspb.Int64Value
func (*WKT) GetRepStringField ¶
func (x *WKT) GetRepStringField() []*wrapperspb.StringValue
func (*WKT) GetRepStructField ¶
func (*WKT) GetRepTimestampField ¶
func (x *WKT) GetRepTimestampField() []*timestamppb.Timestamp
func (*WKT) GetRepUInt32Field ¶
func (x *WKT) GetRepUInt32Field() []*wrapperspb.UInt32Value
func (*WKT) GetRepUInt64Field ¶
func (x *WKT) GetRepUInt64Field() []*wrapperspb.UInt64Value
func (*WKT) GetRepValueField ¶
func (*WKT) GetStringField ¶
func (x *WKT) GetStringField() *wrapperspb.StringValue
func (*WKT) GetStructField ¶
func (*WKT) GetTimestampField ¶
func (x *WKT) GetTimestampField() *timestamppb.Timestamp
func (*WKT) GetUInt32Field ¶
func (x *WKT) GetUInt32Field() *wrapperspb.UInt32Value
func (*WKT) GetUInt64Field ¶
func (x *WKT) GetUInt64Field() *wrapperspb.UInt64Value
func (*WKT) GetValueField ¶
func (*WKT) ProtoMessage ¶
func (*WKT) ProtoMessage()
func (*WKT) ProtoReflect ¶
func (x *WKT) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.