Documentation
¶
Overview ¶
Package json is a JSON parser for request & response body used in JSON-RPC
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RPCError ¶
type RPCError struct {
Code int32 `json:"code,omitempty"`
Message string `json:"message,omitempty"`
}
RPCError is a interface for JSON-RPC error
type RPCRequest ¶
type RPCRequest struct {
Jsonrpc string `json:"jsonrpc"`
Method string `json:"method"`
Params []interface{} `json:"params"`
ID int32 `json:"id"`
}
RPCRequest is a interface for JSON-RPC request
func GetRPCRequestFromJSON ¶
func GetRPCRequestFromJSON(msg string) RPCRequest
GetRPCRequestFromJSON returns RPCRequest struct from JSON
func (*RPCRequest) String ¶
func (r *RPCRequest) String() string
type RPCResponse ¶
type RPCResponse struct {
Jsonrpc string `json:"jsonrpc"`
ID int32 `json:"id"`
Result interface{} `json:"result,omitempty"`
Error *RPCError `json:"error,omitempty"`
}
RPCResponse is a interface for JSON-RPC response
func GetRPCResponseFromJSON ¶
func GetRPCResponseFromJSON(msg string) RPCResponse
GetRPCResponseFromJSON returns RPCRequest struct from JSON
func (*RPCResponse) String ¶
func (r *RPCResponse) String() string
Click to show internal directories.
Click to hide internal directories.