-
Notifications
You must be signed in to change notification settings - Fork 83
/
demo_schema.go
executable file
·43 lines (34 loc) · 1.08 KB
/
demo_schema.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
// Code generated by github.com/actgardner/gogen-avro. DO NOT EDIT.
/*
* SOURCE:
* example.avsc
*/
package avro
import (
"github.com/actgardner/gogen-avro/container"
"io"
)
type DemoSchema struct {
IntField int32
DoubleField float64
StringField string
BoolField bool
BytesField []byte
}
func DeserializeDemoSchema(r io.Reader) (*DemoSchema, error) {
return readDemoSchema(r)
}
func NewDemoSchemaWriter(writer io.Writer, codec container.Codec, recordsPerBlock int64) (*container.Writer, error) {
str := &DemoSchema{}
return container.NewWriter(writer, codec, recordsPerBlock, str.Schema())
}
func NewDemoSchema() *DemoSchema {
v := &DemoSchema{}
return v
}
func (r *DemoSchema) Schema() string {
return "{\"fields\":[{\"name\":\"IntField\",\"type\":\"int\"},{\"name\":\"DoubleField\",\"type\":\"double\"},{\"name\":\"StringField\",\"type\":\"string\"},{\"name\":\"BoolField\",\"type\":\"boolean\"},{\"name\":\"BytesField\",\"type\":\"bytes\"}],\"name\":\"DemoSchema\",\"type\":\"record\"}"
}
func (r *DemoSchema) Serialize(w io.Writer) error {
return writeDemoSchema(r, w)
}