prototests

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package prototests contains some structures and values that are useful for testing the protocol buffer parser.

Index

Constants

This section is empty.

Variables

View Source
var ABigContainer = &BigContainer{
	Field13: proto.Int64(987),
	M:       AContainer,
}

ABigContainer is a populated BigContainer instance.

View Source
var ABigContainerOutput = Nodes{
	Nested(`M`, AContainerOutput...),
	Field(`Field13`, `987`),
}

ABigContainer is a populated BigContainer instance that has been parsed into debug.Nodes.

View Source
var AContainer = &Container{
	Field1: proto.Int64(123),
}

AContainer is a populated Container instance.

View Source
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.

View Source
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",
}
View Source
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",
}
View Source
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

Types

type Big

type Big struct {
	BigField         *int64 `protobuf:"varint,1,opt,name=BigField" json:"BigField,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*Big) Descriptor

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

func (*Big) GetBigField

func (m *Big) GetBigField() int64

func (*Big) ProtoMessage

func (*Big) ProtoMessage()

func (*Big) Reset

func (m *Big) Reset()

func (*Big) String

func (m *Big) String() string

func (*Big) XXX_DiscardUnknown

func (m *Big) XXX_DiscardUnknown()

func (*Big) XXX_Marshal

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

func (*Big) XXX_Merge

func (dst *Big) XXX_Merge(src proto.Message)

func (*Big) XXX_Size

func (m *Big) XXX_Size() int

func (*Big) XXX_Unmarshal

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

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 (*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 NewPopulatedBigMsg(r randyMsg, easy bool) *BigMsg

func (*BigMsg) Descriptor

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

func (*BigMsg) GetField

func (m *BigMsg) GetField() int64

func (*BigMsg) GetMsg

func (m *BigMsg) GetMsg() *SmallMsg

func (*BigMsg) GoString

func (this *BigMsg) GoString() string

func (*BigMsg) ProtoMessage

func (*BigMsg) ProtoMessage()

func (*BigMsg) Reset

func (m *BigMsg) Reset()

func (*BigMsg) String

func (m *BigMsg) String() string

func (*BigMsg) XXX_DiscardUnknown

func (m *BigMsg) XXX_DiscardUnknown()

func (*BigMsg) XXX_Marshal

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

func (*BigMsg) XXX_Merge

func (dst *BigMsg) XXX_Merge(src proto.Message)

func (*BigMsg) XXX_Size

func (m *BigMsg) XXX_Size() int

func (*BigMsg) XXX_Unmarshal

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

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) Descriptor

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

func (*Container) ExtensionRangeArray

func (*Container) ExtensionRangeArray() []proto.ExtensionRange

func (*Container) GetField1

func (m *Container) GetField1() int64

func (*Container) ProtoMessage

func (*Container) ProtoMessage()

func (*Container) Reset

func (m *Container) Reset()

func (*Container) String

func (m *Container) String() string

func (*Container) XXX_DiscardUnknown

func (m *Container) XXX_DiscardUnknown()

func (*Container) XXX_Marshal

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

func (*Container) XXX_Merge

func (dst *Container) XXX_Merge(src proto.Message)

func (*Container) XXX_Size

func (m *Container) XXX_Size() int

func (*Container) XXX_Unmarshal

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

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 NewPopulatedPacked(r randyMsg, easy bool) *Packed

func (*Packed) Descriptor

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

func (*Packed) GetFloats

func (m *Packed) GetFloats() []float64

func (*Packed) GetInts

func (m *Packed) GetInts() []int64

func (*Packed) GetUints

func (m *Packed) GetUints() []uint32

func (*Packed) GoString

func (this *Packed) GoString() string

func (*Packed) ProtoMessage

func (*Packed) ProtoMessage()

func (*Packed) Reset

func (m *Packed) Reset()

func (*Packed) String

func (m *Packed) String() string

func (*Packed) XXX_DiscardUnknown

func (m *Packed) XXX_DiscardUnknown()

func (*Packed) XXX_Marshal

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

func (*Packed) XXX_Merge

func (dst *Packed) XXX_Merge(src proto.Message)

func (*Packed) XXX_Size

func (m *Packed) XXX_Size() int

func (*Packed) XXX_Unmarshal

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

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 NewPopulatedProto3(r randyProto3, easy bool) *Proto3

func (*Proto3) Descriptor

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

func (*Proto3) GetField

func (m *Proto3) GetField() int64

func (*Proto3) GetInts

func (m *Proto3) GetInts() []int64

func (*Proto3) GetMsg

func (m *Proto3) GetMsg() *SmallMsg3

func (*Proto3) GoString

func (this *Proto3) GoString() string

func (*Proto3) ProtoMessage

func (*Proto3) ProtoMessage()

func (*Proto3) Reset

func (m *Proto3) Reset()

func (*Proto3) String

func (m *Proto3) String() string

func (*Proto3) XXX_DiscardUnknown

func (m *Proto3) XXX_DiscardUnknown()

func (*Proto3) XXX_Marshal

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

func (*Proto3) XXX_Merge

func (dst *Proto3) XXX_Merge(src proto.Message)

func (*Proto3) XXX_Size

func (m *Proto3) XXX_Size() int

func (*Proto3) XXX_Unmarshal

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

type Small

type Small struct {
	SmallField       *int64 `protobuf:"varint,1,opt,name=SmallField" json:"SmallField,omitempty"`
	XXX_unrecognized []byte `json:"-"`
}

func (*Small) Descriptor

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

func (*Small) GetSmallField

func (m *Small) GetSmallField() int64

func (*Small) ProtoMessage

func (*Small) ProtoMessage()

func (*Small) Reset

func (m *Small) Reset()

func (*Small) String

func (m *Small) String() string

func (*Small) XXX_DiscardUnknown

func (m *Small) XXX_DiscardUnknown()

func (*Small) XXX_Marshal

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

func (*Small) XXX_Merge

func (dst *Small) XXX_Merge(src proto.Message)

func (*Small) XXX_Size

func (m *Small) XXX_Size() int

func (*Small) XXX_Unmarshal

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

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 NewPopulatedSmallMsg(r randyMsg, easy bool) *SmallMsg

func (*SmallMsg) Descriptor

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

func (*SmallMsg) GetFlightParachute

func (m *SmallMsg) GetFlightParachute() []uint32

func (*SmallMsg) GetMapShark

func (m *SmallMsg) GetMapShark() string

func (*SmallMsg) GetScarBusStop

func (m *SmallMsg) GetScarBusStop() string

func (*SmallMsg) GoString

func (this *SmallMsg) GoString() string

func (*SmallMsg) ProtoMessage

func (*SmallMsg) ProtoMessage()

func (*SmallMsg) Reset

func (m *SmallMsg) Reset()

func (*SmallMsg) String

func (m *SmallMsg) String() string

func (*SmallMsg) XXX_DiscardUnknown

func (m *SmallMsg) XXX_DiscardUnknown()

func (*SmallMsg) XXX_Marshal

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

func (*SmallMsg) XXX_Merge

func (dst *SmallMsg) XXX_Merge(src proto.Message)

func (*SmallMsg) XXX_Size

func (m *SmallMsg) XXX_Size() int

func (*SmallMsg) XXX_Unmarshal

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

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 NewPopulatedSmallMsg3(r randyProto3, easy bool) *SmallMsg3

func (*SmallMsg3) Descriptor

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

func (*SmallMsg3) GetFlightParachute

func (m *SmallMsg3) GetFlightParachute() []uint32

func (*SmallMsg3) GetScarBusStop

func (m *SmallMsg3) GetScarBusStop() string

func (*SmallMsg3) GoString

func (this *SmallMsg3) GoString() string

func (*SmallMsg3) ProtoMessage

func (*SmallMsg3) ProtoMessage()

func (*SmallMsg3) Reset

func (m *SmallMsg3) Reset()

func (*SmallMsg3) String

func (m *SmallMsg3) String() string

func (*SmallMsg3) XXX_DiscardUnknown

func (m *SmallMsg3) XXX_DiscardUnknown()

func (*SmallMsg3) XXX_Marshal

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

func (*SmallMsg3) XXX_Merge

func (dst *SmallMsg3) XXX_Merge(src proto.Message)

func (*SmallMsg3) XXX_Size

func (m *SmallMsg3) XXX_Size() int

func (*SmallMsg3) XXX_Unmarshal

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

Jump to

Keyboard shortcuts

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