Documentation
¶
Overview ¶
Package testtypes defines types for testing the avro package that aren't easily defined in the test package there.
Note: stringer doesn't work on test files, and we want to make sure that enum detection works ok on stringer-generated String methods, hence the reason for this package.
Index ¶
- Variables
- func ProtoEnumName(m map[int32]string, v int32) string
- type CloudEvent
- type Enum
- type LabelFor
- type Message
- type MessageA
- func (*MessageA) Descriptor() ([]byte, []int)
- func (m *MessageA) GetEnabled() bool
- func (m *MessageA) GetFooUrl() string
- func (m *MessageA) GetId() string
- func (m *MessageA) GetLabel() LabelFor
- func (*MessageA) ProtoMessage()
- func (m *MessageA) Reset()
- func (m *MessageA) XXX_DiscardUnknown()
- func (m *MessageA) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MessageA) XXX_Merge(src ProtoMessage)
- func (m *MessageA) XXX_Size() int
- func (m *MessageA) XXX_Unmarshal(b []byte) error
- type MessageB
- func (*MessageB) Descriptor() ([]byte, []int)
- func (m *MessageB) GetArble() *MessageA
- func (m *MessageB) GetSelected() bool
- func (*MessageB) ProtoMessage()
- func (m *MessageB) Reset()
- func (m *MessageB) XXX_DiscardUnknown()
- func (m *MessageB) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MessageB) XXX_Merge(src ProtoMessage)
- func (m *MessageB) XXX_Size() int
- func (m *MessageB) XXX_Unmarshal(b []byte) error
- type Metadata
- type ProtoMessage
Constants ¶
This section is empty.
Variables ¶
var LabelFor_name = map[int32]string{
0: "LABEL_FOR_ZERO",
1: "LABEL_FOR_ONE",
2: "LABEL_FOR_TWO",
3: "LABEL_FOR_THREE",
}
var LabelFor_value = map[string]int32{
"LABEL_FOR_ZERO": 0,
"LABEL_FOR_ONE": 1,
"LABEL_FOR_TWO": 2,
"LABEL_FOR_THREE": 3,
}
Functions ¶
Types ¶
type CloudEvent ¶
type CloudEvent struct {
Time time.Time `json:"time"`
Id string `json:"id"`
Specversion string `json:"specversion"`
Source string `json:"source"`
ExtraField bool `json:"extraField"`
}
func (CloudEvent) AvroRecord ¶
func (CloudEvent) AvroRecord() avrotypegen.RecordInfo
AvroRecord implements the avro.AvroRecord interface.
type LabelFor ¶
type LabelFor int32
LabelFor also has a doc comment.
func (LabelFor) EnumDescriptor ¶
type Message ¶
type Message struct {
Metadata Metadata
}
func (Message) AvroRecord ¶
func (Message) AvroRecord() avrotypegen.RecordInfo
AvroRecord implements the avro.AvroRecord interface.
type MessageA ¶
type MessageA struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Label LabelFor `protobuf:"varint,2,opt,name=label,proto3,enum=arble.foo.v1.LabelFor" json:"label,omitempty"`
FooUrl string `protobuf:"bytes,3,opt,name=foo_url,json=fooUrl,proto3" json:"foo_url,omitempty"`
Enabled bool `protobuf:"varint,4,opt,name=enabled,proto3" json:"enabled,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
MessageA has a doc comment.
func (*MessageA) Descriptor ¶
func (*MessageA) GetEnabled ¶
func (*MessageA) ProtoMessage ¶
func (*MessageA) ProtoMessage()
This is commented out because otherwise the logging in tests calls it, which we don't want.
func (m *MessageA) String() string {
return proto.CompactTextString(m)
}
func (*MessageA) XXX_DiscardUnknown ¶
func (m *MessageA) XXX_DiscardUnknown()
func (*MessageA) XXX_Marshal ¶
func (*MessageA) XXX_Merge ¶
func (m *MessageA) XXX_Merge(src ProtoMessage)
func (*MessageA) XXX_Unmarshal ¶
type MessageB ¶
type MessageB struct {
Arble *MessageA `protobuf:"bytes,1,opt,name=arble,proto3" json:"arble,omitempty"`
Selected bool `protobuf:"varint,2,opt,name=selected,proto3" json:"selected,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
UserDisability is used to show whether a disability has been selected by a user.
func (*MessageB) Descriptor ¶
func (*MessageB) GetSelected ¶
func (*MessageB) ProtoMessage ¶
func (*MessageB) ProtoMessage()
This is commented out because otherwise the logging in tests calls it, which we don't want.
func (m *MessageB) String() string {
return proto.CompactTextString(m)
}
func (*MessageB) XXX_DiscardUnknown ¶
func (m *MessageB) XXX_DiscardUnknown()
func (*MessageB) XXX_Marshal ¶
func (*MessageB) XXX_Merge ¶
func (m *MessageB) XXX_Merge(src ProtoMessage)
func (*MessageB) XXX_Unmarshal ¶
type Metadata ¶
type Metadata struct {
CloudEvent CloudEvent
}
func (Metadata) AvroRecord ¶
func (Metadata) AvroRecord() avrotypegen.RecordInfo
AvroRecord implements the avro.AvroRecord interface.
type ProtoMessage ¶
type ProtoMessage struct{}