-
Notifications
You must be signed in to change notification settings - Fork 87
/
map_array_string.go
75 lines (65 loc) · 2.2 KB
/
map_array_string.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
// Code generated by github.com/actgardner/gogen-avro/v10. DO NOT EDIT.
/*
* SOURCE:
* schema.avsc
*/
package avro
import (
"github.com/actgardner/gogen-avro/v10/vm"
"github.com/actgardner/gogen-avro/v10/vm/types"
"io"
)
func writeMapArrayString(r map[string][]string, 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 = writeArrayString(e, w)
if err != nil {
return err
}
}
return vm.WriteLong(0, w)
}
type MapArrayStringWrapper struct {
Target *map[string][]string
keys []string
values [][]string
}
func (_ *MapArrayStringWrapper) SetBoolean(v bool) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetInt(v int32) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetLong(v int64) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetFloat(v float32) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetDouble(v float64) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetBytes(v []byte) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetString(v string) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetUnionElem(v int64) { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) Get(i int) types.Field { panic("Unsupported operation") }
func (_ *MapArrayStringWrapper) SetDefault(i int) { panic("Unsupported operation") }
func (r *MapArrayStringWrapper) HintSize(s int) {
if r.keys == nil {
r.keys = make([]string, 0, s)
r.values = make([][]string, 0, s)
}
}
func (r *MapArrayStringWrapper) NullField(_ int) {
panic("Unsupported operation")
}
func (r *MapArrayStringWrapper) Finalize() {
for i := range r.keys {
(*r.Target)[r.keys[i]] = r.values[i]
}
}
func (r *MapArrayStringWrapper) AppendMap(key string) types.Field {
r.keys = append(r.keys, key)
var v []string
v = make([]string, 0)
r.values = append(r.values, v)
return &ArrayStringWrapper{Target: &r.values[len(r.values)-1]}
}
func (_ *MapArrayStringWrapper) AppendArray() types.Field { panic("Unsupported operation") }