testprotos

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_sample_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type ContextlessMsg

type ContextlessMsg struct {
	OpaqueField []byte `protobuf:"bytes,1,opt,name=opaque_field,json=opaqueField,proto3" json:"opaque_field,omitempty"`
	// contains filtered or unexported fields
}

ContextlessMsg is designed to carry a message of completely arbitrary type Because there is no context for the type embedded in the message, the opaque type must be dynamically added at runtime

func (*ContextlessMsg) Descriptor deprecated

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

Deprecated: Use ContextlessMsg.ProtoReflect.Descriptor instead.

func (*ContextlessMsg) GetOpaqueField

func (x *ContextlessMsg) GetOpaqueField() []byte

func (*ContextlessMsg) ProtoMessage

func (*ContextlessMsg) ProtoMessage()

func (*ContextlessMsg) ProtoReflect added in v0.3.0

func (x *ContextlessMsg) ProtoReflect() protoreflect.Message

func (*ContextlessMsg) Reset

func (x *ContextlessMsg) Reset()

func (*ContextlessMsg) String

func (x *ContextlessMsg) String() string

func (*ContextlessMsg) VariablyOpaqueFields

func (cm *ContextlessMsg) VariablyOpaqueFields() []string

type DynamicMessageWrapper

type DynamicMessageWrapper struct {
	*ContextlessMsg
	// contains filtered or unexported fields
}

func (*DynamicMessageWrapper) Underlying

func (dmw *DynamicMessageWrapper) Underlying() proto.Message

func (*DynamicMessageWrapper) VariablyOpaqueFieldProto

func (dmw *DynamicMessageWrapper) VariablyOpaqueFieldProto(name string) (proto.Message, error)

type DynamicMsg

type DynamicMsg struct {
	DynamicType       string                     `protobuf:"bytes,1,opt,name=dynamic_type,json=dynamicType,proto3" json:"dynamic_type,omitempty"`
	PlainDynamicField *ContextlessMsg            `protobuf:"bytes,2,opt,name=plain_dynamic_field,json=plainDynamicField,proto3" json:"plain_dynamic_field,omitempty"`
	MapDynamicField   map[string]*ContextlessMsg `` /* 196-byte string literal not displayed */
	SliceDynamicField []*ContextlessMsg          `protobuf:"bytes,4,rep,name=slice_dynamic_field,json=sliceDynamicField,proto3" json:"slice_dynamic_field,omitempty"`
	// contains filtered or unexported fields
}

DynamicMsg is designed to test the dynamic message component The dynamic wrapper applied to ContextlessMsg is determined by dynamic_type

func (*DynamicMsg) Descriptor deprecated

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

Deprecated: Use DynamicMsg.ProtoReflect.Descriptor instead.

func (*DynamicMsg) DynamicFieldProto

func (vom *DynamicMsg) DynamicFieldProto(name string, underlying proto.Message) (proto.Message, error)

func (*DynamicMsg) DynamicFields

func (vom *DynamicMsg) DynamicFields() []string

func (*DynamicMsg) DynamicMapFieldProto

func (vom *DynamicMsg) DynamicMapFieldProto(name string, key string, underlying proto.Message) (proto.Message, error)

func (*DynamicMsg) DynamicMapFields

func (vom *DynamicMsg) DynamicMapFields() []string

func (*DynamicMsg) DynamicSliceFieldProto

func (vom *DynamicMsg) DynamicSliceFieldProto(name string, index int, underlying proto.Message) (proto.Message, error)

func (*DynamicMsg) DynamicSliceFields

func (vom *DynamicMsg) DynamicSliceFields() []string

func (*DynamicMsg) GetDynamicType

func (x *DynamicMsg) GetDynamicType() string

func (*DynamicMsg) GetMapDynamicField

func (x *DynamicMsg) GetMapDynamicField() map[string]*ContextlessMsg

func (*DynamicMsg) GetPlainDynamicField

func (x *DynamicMsg) GetPlainDynamicField() *ContextlessMsg

func (*DynamicMsg) GetSliceDynamicField

func (x *DynamicMsg) GetSliceDynamicField() []*ContextlessMsg

func (*DynamicMsg) ProtoMessage

func (*DynamicMsg) ProtoMessage()

func (*DynamicMsg) ProtoReflect added in v0.3.0

func (x *DynamicMsg) ProtoReflect() protoreflect.Message

func (*DynamicMsg) Reset

func (x *DynamicMsg) Reset()

func (*DynamicMsg) String

func (x *DynamicMsg) String() string

type NestedMsg

type NestedMsg struct {
	PlainNestedField *SimpleMsg            `protobuf:"bytes,1,opt,name=plain_nested_field,json=plainNestedField,proto3" json:"plain_nested_field,omitempty"`
	MapNestedField   map[string]*SimpleMsg `` /* 193-byte string literal not displayed */
	SliceNestedField []*SimpleMsg          `protobuf:"bytes,3,rep,name=slice_nested_field,json=sliceNestedField,proto3" json:"slice_nested_field,omitempty"`
	// contains filtered or unexported fields
}

NestedMsg is designed to test the nested message component

func (*NestedMsg) Descriptor deprecated

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

Deprecated: Use NestedMsg.ProtoReflect.Descriptor instead.

func (*NestedMsg) GetMapNestedField

func (x *NestedMsg) GetMapNestedField() map[string]*SimpleMsg

func (*NestedMsg) GetPlainNestedField

func (x *NestedMsg) GetPlainNestedField() *SimpleMsg

func (*NestedMsg) GetSliceNestedField

func (x *NestedMsg) GetSliceNestedField() []*SimpleMsg

func (*NestedMsg) ProtoMessage

func (*NestedMsg) ProtoMessage()

func (*NestedMsg) ProtoReflect added in v0.3.0

func (x *NestedMsg) ProtoReflect() protoreflect.Message

func (*NestedMsg) Reset

func (x *NestedMsg) Reset()

func (*NestedMsg) String

func (x *NestedMsg) String() string

type SimpleMsg

type SimpleMsg struct {
	PlainField string            `protobuf:"bytes,1,opt,name=plain_field,json=plainField,proto3" json:"plain_field,omitempty"`
	MapField   map[string]string `` /* 173-byte string literal not displayed */
	SliceField []string          `protobuf:"bytes,3,rep,name=slice_field,json=sliceField,proto3" json:"slice_field,omitempty"`
	// contains filtered or unexported fields
}

SimpleMsg is designed to test that all three types of message fields, plain, map, and slice are handled by the protolator tool

func (*SimpleMsg) Descriptor deprecated

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

Deprecated: Use SimpleMsg.ProtoReflect.Descriptor instead.

func (*SimpleMsg) GetMapField

func (x *SimpleMsg) GetMapField() map[string]string

func (*SimpleMsg) GetPlainField

func (x *SimpleMsg) GetPlainField() string

func (*SimpleMsg) GetSliceField

func (x *SimpleMsg) GetSliceField() []string

func (*SimpleMsg) ProtoMessage

func (*SimpleMsg) ProtoMessage()

func (*SimpleMsg) ProtoReflect added in v0.3.0

func (x *SimpleMsg) ProtoReflect() protoreflect.Message

func (*SimpleMsg) Reset

func (x *SimpleMsg) Reset()

func (*SimpleMsg) String

func (x *SimpleMsg) String() string

type StaticallyOpaqueMsg

type StaticallyOpaqueMsg struct {
	PlainOpaqueField []byte            `protobuf:"bytes,1,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"`
	MapOpaqueField   map[string][]byte `` /* 193-byte string literal not displayed */
	SliceOpaqueField [][]byte          `protobuf:"bytes,3,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"`
	// contains filtered or unexported fields
}

StaticallyOpaqueMsg is designed to test the statically opaque message component All fields are statically marshaled to the NestedMsg type

func (*StaticallyOpaqueMsg) Descriptor deprecated

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

Deprecated: Use StaticallyOpaqueMsg.ProtoReflect.Descriptor instead.

func (*StaticallyOpaqueMsg) GetMapOpaqueField

func (x *StaticallyOpaqueMsg) GetMapOpaqueField() map[string][]byte

func (*StaticallyOpaqueMsg) GetPlainOpaqueField

func (x *StaticallyOpaqueMsg) GetPlainOpaqueField() []byte

func (*StaticallyOpaqueMsg) GetSliceOpaqueField

func (x *StaticallyOpaqueMsg) GetSliceOpaqueField() [][]byte

func (*StaticallyOpaqueMsg) ProtoMessage

func (*StaticallyOpaqueMsg) ProtoMessage()

func (*StaticallyOpaqueMsg) ProtoReflect added in v0.3.0

func (x *StaticallyOpaqueMsg) ProtoReflect() protoreflect.Message

func (*StaticallyOpaqueMsg) Reset

func (x *StaticallyOpaqueMsg) Reset()

func (*StaticallyOpaqueMsg) StaticallyOpaqueFieldProto

func (som *StaticallyOpaqueMsg) StaticallyOpaqueFieldProto(name string) (proto.Message, error)

func (*StaticallyOpaqueMsg) StaticallyOpaqueFields

func (som *StaticallyOpaqueMsg) StaticallyOpaqueFields() []string

func (*StaticallyOpaqueMsg) StaticallyOpaqueMapFieldProto

func (som *StaticallyOpaqueMsg) StaticallyOpaqueMapFieldProto(name string, key string) (proto.Message, error)

func (*StaticallyOpaqueMsg) StaticallyOpaqueMapFields

func (som *StaticallyOpaqueMsg) StaticallyOpaqueMapFields() []string

func (*StaticallyOpaqueMsg) StaticallyOpaqueSliceFieldProto

func (som *StaticallyOpaqueMsg) StaticallyOpaqueSliceFieldProto(name string, index int) (proto.Message, error)

func (*StaticallyOpaqueMsg) StaticallyOpaqueSliceFields

func (som *StaticallyOpaqueMsg) StaticallyOpaqueSliceFields() []string

func (*StaticallyOpaqueMsg) String

func (x *StaticallyOpaqueMsg) String() string

type UnmarshalableDeepFields

type UnmarshalableDeepFields struct {
	PlainOpaqueField []byte            `protobuf:"bytes,1,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"`
	MapOpaqueField   map[string][]byte `` /* 193-byte string literal not displayed */
	SliceOpaqueField [][]byte          `protobuf:"bytes,3,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"`
	// contains filtered or unexported fields
}

UnmarshalableDeepFields contains fields which are defined to be opaque, but will return an error if they are asked to be deserialized.

func (*UnmarshalableDeepFields) Descriptor deprecated

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

Deprecated: Use UnmarshalableDeepFields.ProtoReflect.Descriptor instead.

func (*UnmarshalableDeepFields) GetMapOpaqueField

func (x *UnmarshalableDeepFields) GetMapOpaqueField() map[string][]byte

func (*UnmarshalableDeepFields) GetPlainOpaqueField

func (x *UnmarshalableDeepFields) GetPlainOpaqueField() []byte

func (*UnmarshalableDeepFields) GetSliceOpaqueField

func (x *UnmarshalableDeepFields) GetSliceOpaqueField() [][]byte

func (*UnmarshalableDeepFields) ProtoMessage

func (*UnmarshalableDeepFields) ProtoMessage()

func (*UnmarshalableDeepFields) ProtoReflect added in v0.3.0

func (x *UnmarshalableDeepFields) ProtoReflect() protoreflect.Message

func (*UnmarshalableDeepFields) Reset

func (x *UnmarshalableDeepFields) Reset()

func (*UnmarshalableDeepFields) StaticallyOpaqueFieldProto

func (udf *UnmarshalableDeepFields) StaticallyOpaqueFieldProto(name string) (proto.Message, error)

func (*UnmarshalableDeepFields) StaticallyOpaqueFields

func (udf *UnmarshalableDeepFields) StaticallyOpaqueFields() []string

func (*UnmarshalableDeepFields) StaticallyOpaqueMapFieldProto

func (udf *UnmarshalableDeepFields) StaticallyOpaqueMapFieldProto(name, key string) (proto.Message, error)

func (*UnmarshalableDeepFields) StaticallyOpaqueMapFields

func (udf *UnmarshalableDeepFields) StaticallyOpaqueMapFields() []string

func (*UnmarshalableDeepFields) StaticallyOpaqueSliceFieldProto

func (udf *UnmarshalableDeepFields) StaticallyOpaqueSliceFieldProto(name string, index int) (proto.Message, error)

func (*UnmarshalableDeepFields) StaticallyOpaqueSliceFields

func (udf *UnmarshalableDeepFields) StaticallyOpaqueSliceFields() []string

func (*UnmarshalableDeepFields) String

func (x *UnmarshalableDeepFields) String() string

type VariablyOpaqueMsg

type VariablyOpaqueMsg struct {
	OpaqueType       string            `protobuf:"bytes,1,opt,name=opaque_type,json=opaqueType,proto3" json:"opaque_type,omitempty"`
	PlainOpaqueField []byte            `protobuf:"bytes,2,opt,name=plain_opaque_field,json=plainOpaqueField,proto3" json:"plain_opaque_field,omitempty"`
	MapOpaqueField   map[string][]byte `` /* 193-byte string literal not displayed */
	SliceOpaqueField [][]byte          `protobuf:"bytes,4,rep,name=slice_opaque_field,json=sliceOpaqueField,proto3" json:"slice_opaque_field,omitempty"`
	// contains filtered or unexported fields
}

VariablyOpaqueMsg is designed to test the staticaly opaque message component The opaque type is determined by opaque_type

func (*VariablyOpaqueMsg) Descriptor deprecated

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

Deprecated: Use VariablyOpaqueMsg.ProtoReflect.Descriptor instead.

func (*VariablyOpaqueMsg) GetMapOpaqueField

func (x *VariablyOpaqueMsg) GetMapOpaqueField() map[string][]byte

func (*VariablyOpaqueMsg) GetOpaqueType

func (x *VariablyOpaqueMsg) GetOpaqueType() string

func (*VariablyOpaqueMsg) GetPlainOpaqueField

func (x *VariablyOpaqueMsg) GetPlainOpaqueField() []byte

func (*VariablyOpaqueMsg) GetSliceOpaqueField

func (x *VariablyOpaqueMsg) GetSliceOpaqueField() [][]byte

func (*VariablyOpaqueMsg) ProtoMessage

func (*VariablyOpaqueMsg) ProtoMessage()

func (*VariablyOpaqueMsg) ProtoReflect added in v0.3.0

func (x *VariablyOpaqueMsg) ProtoReflect() protoreflect.Message

func (*VariablyOpaqueMsg) Reset

func (x *VariablyOpaqueMsg) Reset()

func (*VariablyOpaqueMsg) String

func (x *VariablyOpaqueMsg) String() string

func (*VariablyOpaqueMsg) VariablyOpaqueFieldProto

func (vom *VariablyOpaqueMsg) VariablyOpaqueFieldProto(name string) (proto.Message, error)

func (*VariablyOpaqueMsg) VariablyOpaqueFields

func (vom *VariablyOpaqueMsg) VariablyOpaqueFields() []string

func (*VariablyOpaqueMsg) VariablyOpaqueMapFieldProto

func (vom *VariablyOpaqueMsg) VariablyOpaqueMapFieldProto(name string, key string) (proto.Message, error)

func (*VariablyOpaqueMsg) VariablyOpaqueMapFields

func (vom *VariablyOpaqueMsg) VariablyOpaqueMapFields() []string

func (*VariablyOpaqueMsg) VariablyOpaqueSliceFieldProto

func (vom *VariablyOpaqueMsg) VariablyOpaqueSliceFieldProto(name string, index int) (proto.Message, error)

func (*VariablyOpaqueMsg) VariablyOpaqueSliceFields

func (vom *VariablyOpaqueMsg) VariablyOpaqueSliceFields() []string

Jump to

Keyboard shortcuts

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