jsonrpcmrgd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(cfg *Config) (jsonrpc.Client, error)

New creates a new client capable of connecting to a JSON-RPC server either over HTTP or WebSocket The function returns an error if the address is invalid or the configuration is missing

Types

type Config

type Config struct {
	// Addr of the JSON-RPC server
	// should be a valid URL with a scheme of either http, https, ws or wss
	Addr string `json:"addr"`
	// HTTP is a configuration for HTTP client MUST be provided if addr scheme is http or https
	HTTP *jsonrpchttp.Config `json:"http"`
	// WS is a configuration for WebSocket client MUST be provided if addr scheme is ws or wss
	WS *jsonrpcws.Config `json:"ws"`
}

Config is a configuration for a JSON-RPC client

func (*Config) SetDefault

func (cfg *Config) SetDefault() *Config

SetDefault sets the default values for the configuration

Jump to

Keyboard shortcuts

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