Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client interface { Call(method string, params ...interface{}) (*RPCResponse, error) CallCtx(ctx context.Context, method string, params ...interface{}) (*RPCResponse, error) }
func NewClientWithOpts ¶
func NewClientWithOpts(endpoint string, opts *ClientOpts) Client
type ClientOpts ¶
type RPCError ¶
type RPCRequest ¶
type RPCRequest struct { JsonRPC string `json:"jsonrpc"` Method string `json:"method"` Params interface{} `json:"params"` ID int `json:"id"` }
func NewRequest ¶
func NewRequest(method string, params ...interface{}) *RPCRequest
type RPCResponse ¶
type RPCResponse struct { JsonRPC string `json:"jsonrpc"` Result interface{} `json:"result,omitempty"` Error *RPCError `json:"error,omitempty"` ID int `json:"id"` }
func (*RPCResponse) GetObject ¶
func (r *RPCResponse) GetObject(toType interface{}) error
type RPCResponses ¶
type RPCResponses []*RPCResponse
Click to show internal directories.
Click to hide internal directories.