-
Notifications
You must be signed in to change notification settings - Fork 83
/
union_ip_address_event.go
81 lines (58 loc) · 2.12 KB
/
union_ip_address_event.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT.
/*
* SOURCE:
* union.avsc
*/
package avro
import (
"errors"
"io"
"github.com/actgardner/gogen-avro/vm"
"github.com/actgardner/gogen-avro/vm/types"
)
type UnionIp_addressEventTypeEnum int
const (
UnionIp_addressEventTypeEnumIp_address UnionIp_addressEventTypeEnum = 0
UnionIp_addressEventTypeEnumEvent UnionIp_addressEventTypeEnum = 1
)
type UnionIp_addressEvent struct {
Ip_address Ip_address
Event Event
UnionType UnionIp_addressEventTypeEnum
}
func writeUnionIp_addressEvent(r UnionIp_addressEvent, w io.Writer) error {
if err := vm.WriteLong(int64(r.UnionType), w); err != nil {
return err
}
switch r.UnionType{
case UnionIp_addressEventTypeEnumIp_address:
return writeIp_address(r.Ip_address, w)
case UnionIp_addressEventTypeEnumEvent:
return writeEvent(r.Event, w)
}
return errors.New("invalid value for UnionIp_addressEvent")
}
func (_ *UnionIp_addressEvent) SetBoolean(v bool) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) SetInt(v int32) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) SetFloat(v float32) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) SetDouble(v float64) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) SetBytes(v []byte) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) SetString(v string) { panic("Unsupported operation") }
func (r *UnionIp_addressEvent) SetLong(v int64) {
r.UnionType = (UnionIp_addressEventTypeEnum)(v)
}
func (r *UnionIp_addressEvent) Get(i int) types.Field {
switch (i) {
case 0:
return &r.Ip_address
case 1:
r.Event = Event{}
return &r.Event
}
panic("Unknown field index")
}
func (r *UnionIp_addressEvent) Clear(i int) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) SetDefault(i int) { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) AppendMap(key string) types.Field { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) AppendArray() types.Field { panic("Unsupported operation") }
func (_ *UnionIp_addressEvent) Finalize() { }