Name changed Id to ID
This commit is contained in:
parent
1ca2416046
commit
3775bb8e38
@ -37,7 +37,7 @@ func (jr *jsonRpc) OnMessage(soc ogw.Socket, messageType int, r io.Reader) []byt
|
||||
|
||||
var result []byte
|
||||
|
||||
if nil != req.Id {
|
||||
if nil != req.ID {
|
||||
result = jr.onRequest(soc, req)
|
||||
} else {
|
||||
jr.onNotify(soc, req)
|
||||
@ -54,7 +54,7 @@ func (jr *jsonRpc) onRequest(soc ogw.Socket, req *ServerRequest) []byte {
|
||||
Protocol: req.Protocol,
|
||||
Result: result,
|
||||
Error: err,
|
||||
Id: req.Id,
|
||||
ID: req.ID,
|
||||
}
|
||||
|
||||
j, err := json.Marshal(res)
|
||||
|
@ -8,11 +8,11 @@ type ServerRequest struct {
|
||||
Protocol string `json:"protocol"`
|
||||
Method string `json:"method"`
|
||||
Params []string `json:"params,omitempty"`
|
||||
Id *json.RawMessage `json:"id,omitempty"`
|
||||
ID *json.RawMessage `json:"id,omitempty"`
|
||||
}
|
||||
|
||||
func (r *ServerRequest) reset() {
|
||||
r.Method = ""
|
||||
r.Params = nil
|
||||
r.Id = nil
|
||||
r.ID = nil
|
||||
}
|
||||
|
@ -8,5 +8,5 @@ type ServerResponse struct {
|
||||
Protocol string `json:"protocol"`
|
||||
Result interface{} `json:"result,omitempty"`
|
||||
Error interface{} `json:"error,omitempty"`
|
||||
Id *json.RawMessage `json:"id,omitempty"`
|
||||
ID *json.RawMessage `json:"id,omitempty"`
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user