This repository has been archived by the owner on Jan 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtemplate.qtpl.go
114 lines (104 loc) · 2.96 KB
/
template.qtpl.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
// Code generated by qtc from "template.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
//line template.qtpl:1
package fastjsonrpc
//line template.qtpl:1
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line template.qtpl:1
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line template.qtpl:1
func streamresponseWithError(qw422016 *qt422016.Writer, id []byte, code ErrorCode, message string, data []byte) {
//line template.qtpl:1
qw422016.N().S(`{"jsonrpc":"2.0","error":{"code":`)
//line template.qtpl:5
qw422016.N().D(int(code))
//line template.qtpl:5
qw422016.N().S(`,"message":"`)
//line template.qtpl:6
qw422016.E().J(message)
//line template.qtpl:6
qw422016.N().S(`"`)
//line template.qtpl:7
if len(data) > 0 {
//line template.qtpl:7
qw422016.N().S(`,"data":`)
//line template.qtpl:8
qw422016.N().Z(data)
//line template.qtpl:9
}
//line template.qtpl:9
qw422016.N().S(`},"id":`)
//line template.qtpl:11
qw422016.N().Z(id)
//line template.qtpl:11
qw422016.N().S(`}`)
//line template.qtpl:13
}
//line template.qtpl:13
func writeresponseWithError(qq422016 qtio422016.Writer, id []byte, code ErrorCode, message string, data []byte) {
//line template.qtpl:13
qw422016 := qt422016.AcquireWriter(qq422016)
//line template.qtpl:13
streamresponseWithError(qw422016, id, code, message, data)
//line template.qtpl:13
qt422016.ReleaseWriter(qw422016)
//line template.qtpl:13
}
//line template.qtpl:13
func responseWithError(id []byte, code ErrorCode, message string, data []byte) string {
//line template.qtpl:13
qb422016 := qt422016.AcquireByteBuffer()
//line template.qtpl:13
writeresponseWithError(qb422016, id, code, message, data)
//line template.qtpl:13
qs422016 := string(qb422016.B)
//line template.qtpl:13
qt422016.ReleaseByteBuffer(qb422016)
//line template.qtpl:13
return qs422016
//line template.qtpl:13
}
//line template.qtpl:15
func streamresponseWithResult(qw422016 *qt422016.Writer, id, result []byte) {
//line template.qtpl:15
qw422016.N().S(`{"jsonrpc":"2.0","result":`)
//line template.qtpl:18
qw422016.N().Z(result)
//line template.qtpl:18
qw422016.N().S(`,"id":`)
//line template.qtpl:19
qw422016.N().Z(id)
//line template.qtpl:19
qw422016.N().S(`}`)
//line template.qtpl:21
}
//line template.qtpl:21
func writeresponseWithResult(qq422016 qtio422016.Writer, id, result []byte) {
//line template.qtpl:21
qw422016 := qt422016.AcquireWriter(qq422016)
//line template.qtpl:21
streamresponseWithResult(qw422016, id, result)
//line template.qtpl:21
qt422016.ReleaseWriter(qw422016)
//line template.qtpl:21
}
//line template.qtpl:21
func responseWithResult(id, result []byte) string {
//line template.qtpl:21
qb422016 := qt422016.AcquireByteBuffer()
//line template.qtpl:21
writeresponseWithResult(qb422016, id, result)
//line template.qtpl:21
qs422016 := string(qb422016.B)
//line template.qtpl:21
qt422016.ReleaseByteBuffer(qb422016)
//line template.qtpl:21
return qs422016
//line template.qtpl:21
}