-
Notifications
You must be signed in to change notification settings - Fork 2
/
recurrer.schema.gen.go
100 lines (88 loc) · 1.11 KB
/
recurrer.schema.gen.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
package storage
import (
"io"
"time"
"unsafe"
)
var (
_ = unsafe.Sizeof(0)
_ = io.ReadFull
_ = time.Now()
)
type Recurrer struct {
ID [16]byte
EntityID [16]byte
TokenID [16]byte
Action uint8
Pool [16]byte
}
func (d *Recurrer) Size() (s uint64) {
{
s += 16
}
{
s += 16
}
{
s += 16
}
{
s += 16
}
s += 1
return
}
func (d *Recurrer) Marshal(buf []byte) ([]byte, error) {
size := d.Size()
{
if uint64(cap(buf)) >= size {
buf = buf[:size]
} else {
buf = make([]byte, size)
}
}
i := uint64(0)
{
copy(buf[i+0:], d.ID[:])
i += 16
}
{
copy(buf[i+0:], d.EntityID[:])
i += 16
}
{
copy(buf[i+0:], d.TokenID[:])
i += 16
}
{
buf[i+0+0] = byte(d.Action >> 0)
}
{
copy(buf[i+1:], d.Pool[:])
i += 16
}
return buf[:i+1], nil
}
func (d *Recurrer) Unmarshal(buf []byte) (uint64, error) {
i := uint64(0)
{
copy(d.ID[:], buf[i+0:])
i += 16
}
{
copy(d.EntityID[:], buf[i+0:])
i += 16
}
{
copy(d.TokenID[:], buf[i+0:])
i += 16
}
{
d.Action = 0 | (uint8(buf[i+0+0]) << 0)
}
{
copy(d.Pool[:], buf[i+1:])
i += 16
}
return i + 1, nil
}