forked from actgardner/gogen-avro
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sync.go
58 lines (50 loc) · 1.88 KB
/
sync.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
// Code generated by Skaidus. DO NOT EDIT.
/*
* SOURCES:
* block.avsc
* header.avsc
*/
package avro
import (
"encoding/json"
"io"
"github.com/Skaidus/gogen-avro/v10/util"
"github.com/Skaidus/gogen-avro/v10/vm/types"
)
func writeSync(r Sync, w io.Writer) error {
_, err := w.Write(r[:])
return err
}
type SyncWrapper struct {
Target *Sync
}
type Sync [16]byte
func (b *Sync) UnmarshalJSON(data []byte) error {
var s string
if err := json.Unmarshal(data, &s); err != nil {
return err
}
codepoints := util.DecodeByteString(s)
copy((*b)[:], codepoints)
return nil
}
func (b Sync) MarshalJSON() ([]byte, error) {
return []byte(util.EncodeByteString(b[:])), nil
}
func (_ SyncWrapper) SetBoolean(v bool) { panic("Unsupported operation") }
func (_ SyncWrapper) SetInt(v int32) { panic("Unsupported operation") }
func (_ SyncWrapper) SetLong(v int64) { panic("Unsupported operation") }
func (_ SyncWrapper) SetFloat(v float32) { panic("Unsupported operation") }
func (_ SyncWrapper) SetDouble(v float64) { panic("Unsupported operation") }
func (r SyncWrapper) SetBytes(v []byte) {
copy((*r.Target)[:], v)
}
func (_ SyncWrapper) SetString(v string) { panic("Unsupported operation") }
func (_ SyncWrapper) SetUnionElem(v int64) { panic("Unsupported operation") }
func (_ SyncWrapper) Get(i int) types.Field { panic("Unsupported operation") }
func (_ SyncWrapper) AppendMap(key string) types.Field { panic("Unsupported operation") }
func (_ SyncWrapper) AppendArray() types.Field { panic("Unsupported operation") }
func (_ SyncWrapper) NullField(int) { panic("Unsupported operation") }
func (_ SyncWrapper) HintSize(int) { panic("Unsupported operation") }
func (_ SyncWrapper) Finalize() {}
func (_ SyncWrapper) SetDefault(i int) { panic("Unsupported operation") }