Documentation
¶
Index ¶
Constants ¶
View Source
const JSONRPC = "2.0"
JSONRPC is the JSON RPC version we support.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
ID int `json:"id"`
Method string `json:"method"`
Params []interface{} `json:"params"`
}
Request is a JSON RPC request.
type Response ¶
type Response struct {
JSONRPC string `json:"jsonrpc"`
ID *int `json:"id"`
Error *json.RawMessage `json:"error"`
Result json.RawMessage `json:"result"`
Method *string `json:"method"`
Params json.RawMessage `json:"params"`
}
Response is a catch-all JSON RPC response. A notification contains: - jsonrpc - method - params A method call response contains: - jsonrpc - id - result - (error)
func (*Response) ParseError ¶
ParseError checks if the JSON RPC response contains an error and extracts its message.
Click to show internal directories.
Click to hide internal directories.