-
Notifications
You must be signed in to change notification settings - Fork 83
/
map_union_int.go
68 lines (59 loc) · 1.98 KB
/
map_union_int.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
// Code generated by github.com/actgardner/gogen-avro/v8. DO NOT EDIT.
/*
* SOURCE:
* schema.avsc
*/
package avro
import (
"github.com/actgardner/gogen-avro/v9/vm"
"github.com/actgardner/gogen-avro/v9/vm/types"
"io"
)
func writeMapUnionInt(r map[string]*UnionInt, w io.Writer) error {
err := vm.WriteLong(int64(len(r)), w)
if err != nil || len(r) == 0 {
return err
}
for k, e := range r {
err = vm.WriteString(k, w)
if err != nil {
return err
}
err = writeUnionInt(e, w)
if err != nil {
return err
}
}
return vm.WriteLong(0, w)
}
type MapUnionIntWrapper struct {
Target *map[string]*UnionInt
keys []string
values []*UnionInt
}
func (_ *MapUnionIntWrapper) SetBoolean(v bool) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetInt(v int32) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetLong(v int64) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetFloat(v float32) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetDouble(v float64) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetBytes(v []byte) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetString(v string) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetUnionElem(v int64) { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) Get(i int) types.Field { panic("Unsupported operation") }
func (_ *MapUnionIntWrapper) SetDefault(i int) { panic("Unsupported operation") }
func (r *MapUnionIntWrapper) NullField(_ int) {
r.values[len(r.values)-1] = nil
}
func (r *MapUnionIntWrapper) Finalize() {
for i := range r.keys {
(*r.Target)[r.keys[i]] = r.values[i]
}
}
func (r *MapUnionIntWrapper) AppendMap(key string) types.Field {
r.keys = append(r.keys, key)
var v *UnionInt
v = NewUnionInt()
r.values = append(r.values, v)
return r.values[len(r.values)-1]
}
func (_ *MapUnionIntWrapper) AppendArray() types.Field { panic("Unsupported operation") }