Documentation ¶
Overview ¶
Package prototests contains some structures and values that are useful for testing the protocol buffer parser.
Index ¶
- Variables
- func ExtensionsDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func MsgDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func Proto3Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- type Big
- func (this *Big) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*Big) Descriptor() ([]byte, []int)
- func (m *Big) GetBigField() int64
- func (*Big) ProtoMessage()
- func (m *Big) Reset()
- func (m *Big) String() string
- func (m *Big) XXX_DiscardUnknown()
- func (m *Big) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Big) XXX_Merge(src proto.Message)
- func (m *Big) XXX_Size() int
- func (m *Big) XXX_Unmarshal(b []byte) error
- type BigContainer
- func (this *BigContainer) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*BigContainer) Descriptor() ([]byte, []int)
- func (*BigContainer) ExtensionRangeArray() []proto.ExtensionRange
- func (m *BigContainer) GetField13() int64
- func (m *BigContainer) GetField2() int64
- func (m *BigContainer) GetM() *Container
- func (*BigContainer) ProtoMessage()
- func (m *BigContainer) Reset()
- func (m *BigContainer) String() string
- func (m *BigContainer) XXX_DiscardUnknown()
- func (m *BigContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BigContainer) XXX_Merge(src proto.Message)
- func (m *BigContainer) XXX_Size() int
- func (m *BigContainer) XXX_Unmarshal(b []byte) error
- type BigMsg
- func (this *BigMsg) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*BigMsg) Descriptor() ([]byte, []int)
- func (m *BigMsg) GetField() int64
- func (m *BigMsg) GetMsg() *SmallMsg
- func (this *BigMsg) GoString() string
- func (*BigMsg) ProtoMessage()
- func (m *BigMsg) Reset()
- func (m *BigMsg) String() string
- func (m *BigMsg) XXX_DiscardUnknown()
- func (m *BigMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *BigMsg) XXX_Merge(src proto.Message)
- func (m *BigMsg) XXX_Size() int
- func (m *BigMsg) XXX_Unmarshal(b []byte) error
- type Container
- func (this *Container) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*Container) Descriptor() ([]byte, []int)
- func (*Container) ExtensionRangeArray() []proto.ExtensionRange
- func (m *Container) GetField1() int64
- func (*Container) ProtoMessage()
- func (m *Container) Reset()
- func (m *Container) String() string
- func (m *Container) XXX_DiscardUnknown()
- func (m *Container) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Container) XXX_Merge(src proto.Message)
- func (m *Container) XXX_Size() int
- func (m *Container) XXX_Unmarshal(b []byte) error
- type Packed
- func (this *Packed) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*Packed) Descriptor() ([]byte, []int)
- func (m *Packed) GetFloats() []float64
- func (m *Packed) GetInts() []int64
- func (m *Packed) GetUints() []uint32
- func (this *Packed) GoString() string
- func (*Packed) ProtoMessage()
- func (m *Packed) Reset()
- func (m *Packed) String() string
- func (m *Packed) XXX_DiscardUnknown()
- func (m *Packed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Packed) XXX_Merge(src proto.Message)
- func (m *Packed) XXX_Size() int
- func (m *Packed) XXX_Unmarshal(b []byte) error
- type Proto3
- func (this *Proto3) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*Proto3) Descriptor() ([]byte, []int)
- func (m *Proto3) GetField() int64
- func (m *Proto3) GetInts() []int64
- func (m *Proto3) GetMsg() *SmallMsg3
- func (this *Proto3) GoString() string
- func (*Proto3) ProtoMessage()
- func (m *Proto3) Reset()
- func (m *Proto3) String() string
- func (m *Proto3) XXX_DiscardUnknown()
- func (m *Proto3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Proto3) XXX_Merge(src proto.Message)
- func (m *Proto3) XXX_Size() int
- func (m *Proto3) XXX_Unmarshal(b []byte) error
- type Small
- func (this *Small) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*Small) Descriptor() ([]byte, []int)
- func (m *Small) GetSmallField() int64
- func (*Small) ProtoMessage()
- func (m *Small) Reset()
- func (m *Small) String() string
- func (m *Small) XXX_DiscardUnknown()
- func (m *Small) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *Small) XXX_Merge(src proto.Message)
- func (m *Small) XXX_Size() int
- func (m *Small) XXX_Unmarshal(b []byte) error
- type SmallMsg
- func (this *SmallMsg) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*SmallMsg) Descriptor() ([]byte, []int)
- func (m *SmallMsg) GetFlightParachute() []uint32
- func (m *SmallMsg) GetMapShark() string
- func (m *SmallMsg) GetScarBusStop() string
- func (this *SmallMsg) GoString() string
- func (*SmallMsg) ProtoMessage()
- func (m *SmallMsg) Reset()
- func (m *SmallMsg) String() string
- func (m *SmallMsg) XXX_DiscardUnknown()
- func (m *SmallMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SmallMsg) XXX_Merge(src proto.Message)
- func (m *SmallMsg) XXX_Size() int
- func (m *SmallMsg) XXX_Unmarshal(b []byte) error
- type SmallMsg3
- func (this *SmallMsg3) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
- func (*SmallMsg3) Descriptor() ([]byte, []int)
- func (m *SmallMsg3) GetFlightParachute() []uint32
- func (m *SmallMsg3) GetScarBusStop() string
- func (this *SmallMsg3) GoString() string
- func (*SmallMsg3) ProtoMessage()
- func (m *SmallMsg3) Reset()
- func (m *SmallMsg3) String() string
- func (m *SmallMsg3) XXX_DiscardUnknown()
- func (m *SmallMsg3) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (dst *SmallMsg3) XXX_Merge(src proto.Message)
- func (m *SmallMsg3) XXX_Size() int
- func (m *SmallMsg3) XXX_Unmarshal(b []byte) error
Constants ¶
This section is empty.
Variables ¶
var ABigContainer = &BigContainer{ Field13: proto.Int64(987), M: AContainer, }
ABigContainer is a populated BigContainer instance.
var ABigContainerOutput = Nodes{ Nested(`M`, AContainerOutput...), Field(`Field13`, `987`), }
ABigContainer is a populated BigContainer instance that has been parsed into debug.Nodes.
var AContainer = &Container{ Field1: proto.Int64(123), }
AContainer is a populated Container instance.
var AContainerOutput = Nodes{
Field(`FieldA`, `0.123`),
Nested(`FieldB`,
Field(`SmallField`, `456`),
),
Nested(`FieldC`,
Field(`BigField`, `789`),
),
Field(`Field1`, `123`),
}
AContainerOutput is a populated Container instance that has been parsed into debug.Nodes.
var E_FieldA = &proto.ExtensionDesc{ ExtendedType: (*Container)(nil), ExtensionType: (*float64)(nil), Field: 100, Name: "prototests.FieldA", Tag: "fixed64,100,opt,name=FieldA", Filename: "extensions.proto", }
var E_FieldB = &proto.ExtensionDesc{ ExtendedType: (*Container)(nil), ExtensionType: (*Small)(nil), Field: 101, Name: "prototests.FieldB", Tag: "bytes,101,opt,name=FieldB", Filename: "extensions.proto", }
var E_FieldC = &proto.ExtensionDesc{ ExtendedType: (*Container)(nil), ExtensionType: (*Big)(nil), Field: 102, Name: "prototests.FieldC", Tag: "bytes,102,opt,name=FieldC", Filename: "extensions.proto", }
Functions ¶
func ExtensionsDescription ¶
func ExtensionsDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func MsgDescription ¶
func MsgDescription() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func Proto3Description ¶
func Proto3Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
Types ¶
type Big ¶
type Big struct { BigField *int64 `protobuf:"varint,1,opt,name=BigField" json:"BigField,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Big) Description ¶
func (this *Big) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*Big) Descriptor ¶
func (*Big) GetBigField ¶
func (*Big) ProtoMessage ¶
func (*Big) ProtoMessage()
func (*Big) XXX_DiscardUnknown ¶
func (m *Big) XXX_DiscardUnknown()
func (*Big) XXX_Unmarshal ¶
type BigContainer ¶
type BigContainer struct { Field2 *int64 `protobuf:"varint,2,opt,name=Field2" json:"Field2,omitempty"` Field13 *int64 `protobuf:"varint,13,opt,name=Field13" json:"Field13,omitempty"` M *Container `protobuf:"bytes,1,opt,name=M" json:"M,omitempty"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` }
BigContainer contains 3 fields and two extension ranges.
func (*BigContainer) Description ¶
func (this *BigContainer) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*BigContainer) Descriptor ¶
func (*BigContainer) Descriptor() ([]byte, []int)
func (*BigContainer) ExtensionRangeArray ¶
func (*BigContainer) ExtensionRangeArray() []proto.ExtensionRange
func (*BigContainer) GetField13 ¶
func (m *BigContainer) GetField13() int64
func (*BigContainer) GetField2 ¶
func (m *BigContainer) GetField2() int64
func (*BigContainer) GetM ¶
func (m *BigContainer) GetM() *Container
func (*BigContainer) ProtoMessage ¶
func (*BigContainer) ProtoMessage()
func (*BigContainer) Reset ¶
func (m *BigContainer) Reset()
func (*BigContainer) String ¶
func (m *BigContainer) String() string
func (*BigContainer) XXX_DiscardUnknown ¶
func (m *BigContainer) XXX_DiscardUnknown()
func (*BigContainer) XXX_Marshal ¶
func (m *BigContainer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BigContainer) XXX_Merge ¶
func (dst *BigContainer) XXX_Merge(src proto.Message)
func (*BigContainer) XXX_Size ¶
func (m *BigContainer) XXX_Size() int
func (*BigContainer) XXX_Unmarshal ¶
func (m *BigContainer) XXX_Unmarshal(b []byte) error
type BigMsg ¶
type BigMsg struct { Field *int64 `protobuf:"varint,1,opt,name=Field" json:"Field,omitempty"` Msg *SmallMsg `protobuf:"bytes,3,opt,name=Msg" json:"Msg,omitempty"` XXX_unrecognized []byte `json:"-"` }
BigMsg contains a field and a message field.
func NewPopulatedBigMsg ¶
func (*BigMsg) Description ¶
func (this *BigMsg) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*BigMsg) Descriptor ¶
func (*BigMsg) ProtoMessage ¶
func (*BigMsg) ProtoMessage()
func (*BigMsg) XXX_DiscardUnknown ¶
func (m *BigMsg) XXX_DiscardUnknown()
func (*BigMsg) XXX_Marshal ¶
func (*BigMsg) XXX_Unmarshal ¶
type Container ¶
type Container struct { Field1 *int64 `protobuf:"varint,1,opt,name=Field1" json:"Field1,omitempty"` proto.XXX_InternalExtensions `json:"-"` XXX_unrecognized []byte `json:"-"` }
Container contains a field and some extensions.
func (*Container) Description ¶
func (this *Container) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*Container) Descriptor ¶
func (*Container) ExtensionRangeArray ¶
func (*Container) ExtensionRangeArray() []proto.ExtensionRange
func (*Container) ProtoMessage ¶
func (*Container) ProtoMessage()
func (*Container) XXX_DiscardUnknown ¶
func (m *Container) XXX_DiscardUnknown()
func (*Container) XXX_Marshal ¶
func (*Container) XXX_Unmarshal ¶
type Packed ¶
type Packed struct { Ints []int64 `protobuf:"varint,4,rep,packed,name=Ints" json:"Ints,omitempty"` Floats []float64 `protobuf:"fixed64,5,rep,packed,name=Floats" json:"Floats,omitempty"` Uints []uint32 `protobuf:"varint,6,rep,packed,name=Uints" json:"Uints,omitempty"` XXX_unrecognized []byte `json:"-"` }
Packed contains some repeated packed fields.
func NewPopulatedPacked ¶
func (*Packed) Description ¶
func (this *Packed) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*Packed) Descriptor ¶
func (*Packed) ProtoMessage ¶
func (*Packed) ProtoMessage()
func (*Packed) XXX_DiscardUnknown ¶
func (m *Packed) XXX_DiscardUnknown()
func (*Packed) XXX_Marshal ¶
func (*Packed) XXX_Unmarshal ¶
type Proto3 ¶
type Proto3 struct { Field int64 `protobuf:"varint,1,opt,name=Field,proto3" json:"Field,omitempty"` Msg *SmallMsg3 `protobuf:"bytes,3,opt,name=Msg" json:"Msg,omitempty"` Ints []int64 `protobuf:"varint,4,rep,packed,name=Ints" json:"Ints,omitempty"` XXX_unrecognized []byte `json:"-"` }
Proto3 is a proto3 message.
func NewPopulatedProto3 ¶
func (*Proto3) Description ¶
func (this *Proto3) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*Proto3) Descriptor ¶
func (*Proto3) ProtoMessage ¶
func (*Proto3) ProtoMessage()
func (*Proto3) XXX_DiscardUnknown ¶
func (m *Proto3) XXX_DiscardUnknown()
func (*Proto3) XXX_Marshal ¶
func (*Proto3) XXX_Unmarshal ¶
type Small ¶
type Small struct { SmallField *int64 `protobuf:"varint,1,opt,name=SmallField" json:"SmallField,omitempty"` XXX_unrecognized []byte `json:"-"` }
func (*Small) Description ¶
func (this *Small) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*Small) Descriptor ¶
func (*Small) GetSmallField ¶
func (*Small) ProtoMessage ¶
func (*Small) ProtoMessage()
func (*Small) XXX_DiscardUnknown ¶
func (m *Small) XXX_DiscardUnknown()
func (*Small) XXX_Marshal ¶
func (*Small) XXX_Unmarshal ¶
type SmallMsg ¶
type SmallMsg struct { ScarBusStop *string `protobuf:"bytes,1,opt,name=ScarBusStop" json:"ScarBusStop,omitempty"` FlightParachute []uint32 `protobuf:"fixed32,12,rep,name=FlightParachute" json:"FlightParachute,omitempty"` MapShark *string `protobuf:"bytes,18,opt,name=MapShark" json:"MapShark,omitempty"` XXX_unrecognized []byte `json:"-"` }
SmallMsg only contains some native fields.
func NewPopulatedSmallMsg ¶
func (*SmallMsg) Description ¶
func (this *SmallMsg) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*SmallMsg) Descriptor ¶
func (*SmallMsg) GetFlightParachute ¶
func (*SmallMsg) GetMapShark ¶
func (*SmallMsg) GetScarBusStop ¶
func (*SmallMsg) ProtoMessage ¶
func (*SmallMsg) ProtoMessage()
func (*SmallMsg) XXX_DiscardUnknown ¶
func (m *SmallMsg) XXX_DiscardUnknown()
func (*SmallMsg) XXX_Marshal ¶
func (*SmallMsg) XXX_Unmarshal ¶
type SmallMsg3 ¶
type SmallMsg3 struct { ScarBusStop string `protobuf:"bytes,1,opt,name=ScarBusStop,proto3" json:"ScarBusStop,omitempty"` FlightParachute []uint32 `protobuf:"fixed32,12,rep,packed,name=FlightParachute" json:"FlightParachute,omitempty"` XXX_unrecognized []byte `json:"-"` }
SmallMsg3 only contains some native fields.
func NewPopulatedSmallMsg3 ¶
func (*SmallMsg3) Description ¶
func (this *SmallMsg3) Description() (desc *github_com_gogo_protobuf_protoc_gen_gogo_descriptor.FileDescriptorSet)
func (*SmallMsg3) Descriptor ¶
func (*SmallMsg3) GetFlightParachute ¶
func (*SmallMsg3) GetScarBusStop ¶
func (*SmallMsg3) ProtoMessage ¶
func (*SmallMsg3) ProtoMessage()
func (*SmallMsg3) XXX_DiscardUnknown ¶
func (m *SmallMsg3) XXX_DiscardUnknown()