-
Notifications
You must be signed in to change notification settings - Fork 0
/
oneof_test.go
39 lines (28 loc) · 942 Bytes
/
oneof_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package protowire
type testOneOf struct {
Name string `protowire:"1,2,string,optional"`
TestIdentifier isTestOneOf_TestIdentifier `protowire_oneof:"true"`
TestMessage isTestOneOf_TestMessage `protowire_oneof:"true"`
}
type isTestOneOf_TestIdentifier interface {
isTestOneOfIdentifier()
}
type TestOneOf_Id struct {
Id string `protowire:"2,2,string,oneof"`
}
func (*TestOneOf_Id) isTestOneOfIdentifier() {}
type TestOneOf_Email struct {
Email string `protowire:"3,2,string,oneof"`
}
func (*TestOneOf_Email) isTestOneOfIdentifier() {}
type isTestOneOf_TestMessage interface {
isTestOneOfMessage()
}
type TestOneOf_TextMessage struct {
TextMessage string `protowire:"4,2,string,oneof"`
}
func (*TestOneOf_TextMessage) isTestOneOfMessage() {}
type TestOneOf_BinaryMessage struct {
BinaryMessage []byte `protowire:"5,2,bytes,oneof"`
}
func (*TestOneOf_BinaryMessage) isTestOneOfMessage() {}