-
Notifications
You must be signed in to change notification settings - Fork 17
/
types_gen.go
247 lines (235 loc) · 4.88 KB
/
types_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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
package jeff
// Code generated by github.com/tinylib/msgp DO NOT EDIT.
import (
"github.com/tinylib/msgp/msgp"
)
// DecodeMsg implements msgp.Decodable
func (z *Session) DecodeMsg(dc *msgp.Reader) (err error) {
var field []byte
_ = field
var zb0001 uint32
zb0001, err = dc.ReadMapHeader()
if err != nil {
return
}
for zb0001 > 0 {
zb0001--
field, err = dc.ReadMapKeyPtr()
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "key":
z.Key, err = dc.ReadBytes(z.Key)
if err != nil {
return
}
case "token":
z.Token, err = dc.ReadBytes(z.Token)
if err != nil {
return
}
case "meta":
z.Meta, err = dc.ReadBytes(z.Meta)
if err != nil {
return
}
case "exp":
z.Exp, err = dc.ReadTime()
if err != nil {
return
}
default:
err = dc.Skip()
if err != nil {
return
}
}
}
return
}
// EncodeMsg implements msgp.Encodable
func (z *Session) EncodeMsg(en *msgp.Writer) (err error) {
// map header, size 4
// write "key"
err = en.Append(0x84, 0xa3, 0x6b, 0x65, 0x79)
if err != nil {
return
}
err = en.WriteBytes(z.Key)
if err != nil {
return
}
// write "token"
err = en.Append(0xa5, 0x74, 0x6f, 0x6b, 0x65, 0x6e)
if err != nil {
return
}
err = en.WriteBytes(z.Token)
if err != nil {
return
}
// write "meta"
err = en.Append(0xa4, 0x6d, 0x65, 0x74, 0x61)
if err != nil {
return
}
err = en.WriteBytes(z.Meta)
if err != nil {
return
}
// write "exp"
err = en.Append(0xa3, 0x65, 0x78, 0x70)
if err != nil {
return
}
err = en.WriteTime(z.Exp)
if err != nil {
return
}
return
}
// MarshalMsg implements msgp.Marshaler
func (z *Session) MarshalMsg(b []byte) (o []byte, err error) {
o = msgp.Require(b, z.Msgsize())
// map header, size 4
// string "key"
o = append(o, 0x84, 0xa3, 0x6b, 0x65, 0x79)
o = msgp.AppendBytes(o, z.Key)
// string "token"
o = append(o, 0xa5, 0x74, 0x6f, 0x6b, 0x65, 0x6e)
o = msgp.AppendBytes(o, z.Token)
// string "meta"
o = append(o, 0xa4, 0x6d, 0x65, 0x74, 0x61)
o = msgp.AppendBytes(o, z.Meta)
// string "exp"
o = append(o, 0xa3, 0x65, 0x78, 0x70)
o = msgp.AppendTime(o, z.Exp)
return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *Session) UnmarshalMsg(bts []byte) (o []byte, err error) {
var field []byte
_ = field
var zb0001 uint32
zb0001, bts, err = msgp.ReadMapHeaderBytes(bts)
if err != nil {
return
}
for zb0001 > 0 {
zb0001--
field, bts, err = msgp.ReadMapKeyZC(bts)
if err != nil {
return
}
switch msgp.UnsafeString(field) {
case "key":
z.Key, bts, err = msgp.ReadBytesBytes(bts, z.Key)
if err != nil {
return
}
case "token":
z.Token, bts, err = msgp.ReadBytesBytes(bts, z.Token)
if err != nil {
return
}
case "meta":
z.Meta, bts, err = msgp.ReadBytesBytes(bts, z.Meta)
if err != nil {
return
}
case "exp":
z.Exp, bts, err = msgp.ReadTimeBytes(bts)
if err != nil {
return
}
default:
bts, err = msgp.Skip(bts)
if err != nil {
return
}
}
}
o = bts
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z *Session) Msgsize() (s int) {
s = 1 + 4 + msgp.BytesPrefixSize + len(z.Key) + 6 + msgp.BytesPrefixSize + len(z.Token) + 5 + msgp.BytesPrefixSize + len(z.Meta) + 4 + msgp.TimeSize
return
}
// DecodeMsg implements msgp.Decodable
func (z *SessionList) DecodeMsg(dc *msgp.Reader) (err error) {
var zb0002 uint32
zb0002, err = dc.ReadArrayHeader()
if err != nil {
return
}
if cap((*z)) >= int(zb0002) {
(*z) = (*z)[:zb0002]
} else {
(*z) = make(SessionList, zb0002)
}
for zb0001 := range *z {
err = (*z)[zb0001].DecodeMsg(dc)
if err != nil {
return
}
}
return
}
// EncodeMsg implements msgp.Encodable
func (z SessionList) EncodeMsg(en *msgp.Writer) (err error) {
err = en.WriteArrayHeader(uint32(len(z)))
if err != nil {
return
}
for zb0003 := range z {
err = z[zb0003].EncodeMsg(en)
if err != nil {
return
}
}
return
}
// MarshalMsg implements msgp.Marshaler
func (z SessionList) MarshalMsg(b []byte) (o []byte, err error) {
o = msgp.Require(b, z.Msgsize())
o = msgp.AppendArrayHeader(o, uint32(len(z)))
for zb0003 := range z {
o, err = z[zb0003].MarshalMsg(o)
if err != nil {
return
}
}
return
}
// UnmarshalMsg implements msgp.Unmarshaler
func (z *SessionList) UnmarshalMsg(bts []byte) (o []byte, err error) {
var zb0002 uint32
zb0002, bts, err = msgp.ReadArrayHeaderBytes(bts)
if err != nil {
return
}
if cap((*z)) >= int(zb0002) {
(*z) = (*z)[:zb0002]
} else {
(*z) = make(SessionList, zb0002)
}
for zb0001 := range *z {
bts, err = (*z)[zb0001].UnmarshalMsg(bts)
if err != nil {
return
}
}
o = bts
return
}
// Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (z SessionList) Msgsize() (s int) {
s = msgp.ArrayHeaderSize
for zb0003 := range z {
s += z[zb0003].Msgsize()
}
return
}