-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathresponse_easyjson.go
72 lines (68 loc) · 1.59 KB
/
response_easyjson.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
// AUTOGENERATED FILE: easyjson marshaller/unmarshallers.
package th_tools
import (
json "encoding/json"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
var _ = json.RawMessage{} // suppress unused package warning
func easyjson_6ff3ac1d_decode_th_tools_Response(in *jlexer.Lexer, out *Response) {
if in.IsNull() {
in.Skip()
return
}
in.Delim('{')
for !in.IsDelim('}') {
key := in.UnsafeString()
in.WantColon()
if in.IsNull() {
in.Skip()
in.WantComma()
continue
}
switch key {
case "Status":
out.Status = string(in.String())
case "Body":
out.Body = in.Interface()
default:
in.SkipRecursive()
}
in.WantComma()
}
in.Delim('}')
}
func easyjson_6ff3ac1d_encode_th_tools_Response(out *jwriter.Writer, in Response) {
out.RawByte('{')
first := true
_ = first
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Status\":")
out.String(string(in.Status))
if !first {
out.RawByte(',')
}
first = false
out.RawString("\"Body\":")
out.Raw(json.Marshal(in.Body))
out.RawByte('}')
}
func (v Response) MarshalJSON() ([]byte, error) {
w := jwriter.Writer{}
easyjson_6ff3ac1d_encode_th_tools_Response(&w, v)
return w.Buffer.BuildBytes(), w.Error
}
func (v Response) MarshalEasyJSON(w *jwriter.Writer) {
easyjson_6ff3ac1d_encode_th_tools_Response(w, v)
}
func (v *Response) UnmarshalJSON(data []byte) error {
r := jlexer.Lexer{Data: data}
easyjson_6ff3ac1d_decode_th_tools_Response(&r, v)
return r.Error()
}
func (v *Response) UnmarshalEasyJSON(l *jlexer.Lexer) {
easyjson_6ff3ac1d_decode_th_tools_Response(l, v)
}