-
Notifications
You must be signed in to change notification settings - Fork 83
/
array_test_record.go
124 lines (87 loc) · 2.92 KB
/
array_test_record.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT.
/*
* SOURCE:
* arrays.avsc
*/
package avro
import (
"io"
"github.com/actgardner/gogen-avro/vm/types"
"github.com/actgardner/gogen-avro/vm"
"github.com/actgardner/gogen-avro/compiler"
)
type ArrayTestRecord struct {
IntField []*UnionNullInt
}
const ArrayTestRecordAvroCRC64Fingerprint = "t\x06\x9e\xc8\u0088\xa0\xcb"
func NewArrayTestRecord() (*ArrayTestRecord) {
return &ArrayTestRecord{}
}
func DeserializeArrayTestRecord(r io.Reader) (*ArrayTestRecord, error) {
t := NewArrayTestRecord()
deser, err := compiler.CompileSchemaBytes([]byte(t.Schema()), []byte(t.Schema()))
if err != nil {
return nil, err
}
err = vm.Eval(r, deser, t)
if err != nil {
return nil, err
}
return t, err
}
func DeserializeArrayTestRecordFromSchema(r io.Reader, schema string) (*ArrayTestRecord, error) {
t := NewArrayTestRecord()
deser, err := compiler.CompileSchemaBytes([]byte(schema), []byte(t.Schema()))
if err != nil {
return nil, err
}
err = vm.Eval(r, deser, t)
if err != nil {
return nil, err
}
return t, err
}
func writeArrayTestRecord(r *ArrayTestRecord, w io.Writer) error {
var err error
err = writeArrayUnionNullInt( r.IntField, w)
if err != nil {
return err
}
return err
}
func (r *ArrayTestRecord) Serialize(w io.Writer) error {
return writeArrayTestRecord(r, w)
}
func (r *ArrayTestRecord) Schema() string {
return "{\"fields\":[{\"name\":\"IntField\",\"type\":{\"items\":[\"null\",\"int\"],\"type\":\"array\"}}],\"name\":\"ArrayTestRecord\",\"type\":\"record\"}"
}
func (r *ArrayTestRecord) SchemaName() string {
return "ArrayTestRecord"
}
func (_ *ArrayTestRecord) SetBoolean(v bool) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetInt(v int32) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetLong(v int64) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetFloat(v float32) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetDouble(v float64) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetBytes(v []byte) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetString(v string) { panic("Unsupported operation") }
func (_ *ArrayTestRecord) SetUnionElem(v int64) { panic("Unsupported operation") }
func (r *ArrayTestRecord) Get(i int) types.Field {
switch (i) {
case 0:
r.IntField = make([]*UnionNullInt, 0)
return (*ArrayUnionNullIntWrapper)(&r.IntField)
}
panic("Unknown field index")
}
func (r *ArrayTestRecord) SetDefault(i int) {
switch (i) {
}
panic("Unknown field index")
}
func (_ *ArrayTestRecord) AppendMap(key string) types.Field { panic("Unsupported operation") }
func (_ *ArrayTestRecord) AppendArray() types.Field { panic("Unsupported operation") }
func (_ *ArrayTestRecord) Finalize() { }
func (_ *ArrayTestRecord) AvroCRC64Fingerprint() []byte {
return []byte(ArrayTestRecordAvroCRC64Fingerprint)
}