@@ -13,6 +13,7 @@ import (
13
13
"github.com/francoispqt/gojay"
14
14
)
15
15
16
+ // Version represents a JSONRPC version.
16
17
const Version = "2.0"
17
18
18
19
// ID is a Request identifier.
@@ -70,20 +71,6 @@ func (m RawMessage) String() string {
70
71
return * (* string )(unsafe .Pointer (& m ))
71
72
}
72
73
73
- // Read implements io.Reader.
74
- // func (m *RawMessage) Read(p []byte) (n int, err error) {
75
- // if len(p) == 0 || p == nil {
76
- // return 0, nil
77
- // }
78
- // if m == nil {
79
- // return 0, io.EOF
80
- // }
81
- //
82
- // n = copy(p, *m)
83
- //
84
- // return n, nil
85
- // }
86
-
87
74
// MarshalJSON implements json.Marshaler.
88
75
//
89
76
// The returns m as the JSON encoding of m.
@@ -108,7 +95,6 @@ func (m *RawMessage) UnmarshalJSON(data []byte) error {
108
95
return nil
109
96
}
110
97
111
- // var _ io.Reader = (*RawMessage)(nil)
112
98
var _ json.Marshaler = (* RawMessage )(nil )
113
99
var _ json.Unmarshaler = (* RawMessage )(nil )
114
100
@@ -126,7 +112,7 @@ type Request struct {
126
112
Method string `json:"method"`
127
113
128
114
// The method's params.
129
- Params * RawMessage `json:"params,omitempty"`
115
+ Params * json. RawMessage `json:"params,omitempty"`
130
116
}
131
117
132
118
// IsNotify returns true if this request is a notification.
@@ -151,7 +137,7 @@ type Response struct {
151
137
152
138
// The result of a request. This member is REQUIRED on success.
153
139
// This member MUST NOT exist if there was an error invoking the method.
154
- Result * RawMessage `json:"result,omitempty"`
140
+ Result * json. RawMessage `json:"result,omitempty"`
155
141
}
156
142
157
143
// Combined represents a all the fields of both Request and Response.
@@ -166,14 +152,14 @@ type Combined struct {
166
152
Method string `json:"method"`
167
153
168
154
// The method's params.
169
- Params * RawMessage `json:"params,omitempty"`
155
+ Params * json. RawMessage `json:"params,omitempty"`
170
156
171
157
// The error object in case a request fails.
172
158
Error * Error `json:"error,omitempty"`
173
159
174
160
// The result of a request. This member is REQUIRED on success.
175
161
// This member MUST NOT exist if there was an error invoking the method.
176
- Result * RawMessage `json:"result,omitempty"`
162
+ Result * json. RawMessage `json:"result,omitempty"`
177
163
}
178
164
179
165
// NotificationMessage is a notification message.
@@ -187,5 +173,5 @@ type NotificationMessage struct {
187
173
Method string `json:"method"`
188
174
189
175
// Params is the notification's params.
190
- Params * RawMessage `json:"params,omitempty"`
176
+ Params * json. RawMessage `json:"params,omitempty"`
191
177
}
0 commit comments