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