Documentation
¶
Index ¶
Constants ¶
View Source
const Version = "2.0"
Version is a JSONRPC version
Variables ¶
This section is empty.
Functions ¶
func MarshalRequest ¶
MarshalRequest JSONRPC request bytes from a Request struct
func MarshalRequestStringParams ¶
func MarshalRequestStringParams(r RequestStringParams) []byte
MarshalRequestStringParams creates a JSONRPC request bytes from a RequestStringParams struct
func MarshalResponse ¶
MarshalResponse creates a JSONRPC response bytes from a Response struct
Types ¶
type Request ¶
type Request struct {
JSONRPCVersion string `json:"jsonrpc"`
ID int `json:"id"`
Method string `json:"method"`
Params interface{} `json:"params"`
}
Request specifies the JSONRPC gateway request
type RequestStringParams ¶
type RequestStringParams struct {
JSONRPCVersion string `json:"jsonrpc"`
ID int `json:"id"`
Method string `json:"method"`
Params []string `json:"params"`
}
RequestStringParams specifies the JSONRPC gateway request
func UnmarshalRequest ¶
func UnmarshalRequest(b []byte) (RequestStringParams, error)
UnmarshalRequest parses the JSONRPC request, and returns it as a Request struct
type Response ¶
type Response struct {
JSONRPCVersion string `json:"jsonrpc"`
ID int `json:"id"`
Result interface{} `json:"result"`
Error interface{} `json:"error"`
}
Response specifies the JSONRPC gateway response
func UnmarshalResponse ¶
UnmarshalResponse parses the JSONRPC request, and returns it as a Response struct
Click to show internal directories.
Click to hide internal directories.