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