(method string, id, params interface{})
| 77 | } |
| 78 | |
| 79 | func NewJSON2Request(method string, id, params interface{}) *JSON2Request { |
| 80 | j := new(JSON2Request) |
| 81 | j.JSONRPC = "2.0" |
| 82 | j.ID = id |
| 83 | if b, err := json.Marshal(params); err == nil { |
| 84 | j.Params = b |
| 85 | } |
| 86 | j.Method = method |
| 87 | return j |
| 88 | } |
| 89 | |
| 90 | func ParseJSON2Request(request string) (*JSON2Request, error) { |
| 91 | j := new(JSON2Request) |
no outgoing calls
no test coverage detected