jsonrpcws

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2025 License: MIT Imports: 9 Imported by: 0

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 is a JSON-RPC client that communicates over a WebSocket connection.

func NewClient

func NewClient(addr string, cfg *Config) (*Client, error)

NewClient creates a new JSON-RPC WebSocket client.

func NewFromClient

func NewFromClient(c *ws.Client) *Client

NewFromClient creates a new JSON-RPC WebSocket client from an existing WebSocket client.

func (*Client) Call

func (c *Client) Call(ctx context.Context, r *jsonrpc.Request, res interface{}) error

Call sends a JSON-RPC request and waits for a response.

func (*Client) Errors

func (c *Client) Errors() <-chan error

func (*Client) Start

func (c *Client) Start(ctx context.Context) error

func (*Client) Stop

func (c *Client) Stop(ctx context.Context) error

type Config

type Config struct {
	Client *ws.ClientConfig // WebSocket client configuration
}

func (*Config) SetDefault

func (cfg *Config) SetDefault() *Config

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL