Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents an connection to a Json RPC server
func Dial ¶
Dial initializes a background context and creates a new client for the given unix domain socket and API path
Currently the dial function is dedicated to establish a local unix domain socket connection using UNIX domain sockets based on websocket connection.
The client reconnects automatically if the connection is lost
func DialWithContext ¶
DialWithContext creates a new client to connect to the server
func (*Client) Call ¶
Call initializes a background context and performs a JSON-RPC call with the given arguments and unmarshals into result if no error occurred
The result must be a pointer so that package json can unmarshal into it. Nil object should not be passed into
future improvement: could deliver error message as well
func (*Client) CallWithContext ¶
func (c *Client) CallWithContext(ctx context.Context, method string, args interface{}, result interface{}) error
CallWithContext performs a JSON-RPC call with the given arguments and unmarshals into result if no error occurred