Versions in this module Expand all Collapse all v0 v0.0.1 May 24, 2022 Changes in this version + const URIClientRequestID + func DefaultHTTPClient(remoteAddr string) (*http.Client, error) + type Caller interface + Call func(ctx context.Context, method string, params map[string]interface{}, ...) (interface{}, error) + type Client struct + func New(remote string) (*Client, error) + func NewWithHTTPClient(remote string, c *http.Client) (*Client, error) + func (c *Client) Call(ctx context.Context, method string, params map[string]interface{}, ...) (interface{}, error) + func (c *Client) NewRequestBatch() *RequestBatch + type HTTPClient interface + Call func(ctx context.Context, method string, params map[string]interface{}, ...) (interface{}, error) + type RequestBatch struct + func (b *RequestBatch) Call(_ context.Context, method string, params map[string]interface{}, ...) (interface{}, error) + func (b *RequestBatch) Clear() int + func (b *RequestBatch) Count() int + func (b *RequestBatch) Send(ctx context.Context) ([]interface{}, error) + type URIClient struct + func NewURI(remote string) (*URIClient, error) + func (c *URIClient) Call(ctx context.Context, method string, params map[string]interface{}, ...) (interface{}, error) + type WSClient struct + Address string + Dialer func(string, string) (net.Conn, error) + Endpoint string + PingPongLatencyTimer metrics.Timer + ResponsesCh chan types.RPCResponse + func NewWS(remoteAddr, endpoint string) (*WSClient, error) + func NewWSWithOptions(remoteAddr, endpoint string, opts WSOptions) (*WSClient, error) + func (c *WSClient) Call(ctx context.Context, method string, params map[string]interface{}) error + func (c *WSClient) CallWithArrayParams(ctx context.Context, method string, params []interface{}) error + func (c *WSClient) IsActive() bool + func (c *WSClient) IsReconnecting() bool + func (c *WSClient) OnReconnect(cb func()) + func (c *WSClient) OnStart() error + func (c *WSClient) Send(ctx context.Context, request types.RPCRequest) error + func (c *WSClient) Stop() error + func (c *WSClient) String() string + func (c *WSClient) Subscribe(ctx context.Context, query string) error + func (c *WSClient) Unsubscribe(ctx context.Context, query string) error + func (c *WSClient) UnsubscribeAll(ctx context.Context) error + type WSOptions struct + MaxReconnectAttempts uint + PingPeriod time.Duration + ReadWait time.Duration + WriteWait time.Duration + func DefaultWSOptions() WSOptions