Name changed Id to ID

This commit is contained in:
crusader 2017-09-11 13:44:51 +09:00
parent 1ca2416046
commit 3775bb8e38
3 changed files with 5 additions and 5 deletions

View File

@ -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)

View File

@ -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
}

View File

@ -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"`
}