rpcclient

package
v3.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRPC = errors.New("rpc error")

ErrRPC is an error in the RPC protocol

Functions

This section is empty.

Types

type RPCClient

type RPCClient struct {
	*grpcclient.GRPCClient
	// contains filtered or unexported fields
}

RPCClient is an RPC client

func NewRPCClient

func NewRPCClient(rpcAddress string) (*RPCClient, error)

сreates a new RPC client with a default call timeout value

func (*RPCClient) Address

func (c *RPCClient) Address() string

Address returns the address the RPC client connected to

func (*RPCClient) Close

func (c *RPCClient) Close() error

Close closes the RPC client

func (*RPCClient) GetInfo

GetInfo sends an RPC request respective to the function's name and returns the RPC server's response

func (*RPCClient) Reconnect

func (c *RPCClient) Reconnect() error

Reconnect forces the client to attempt to reconnect to the address this client initially was connected to

func (*RPCClient) SetLogger

func (c *RPCClient) SetLogger(backend *logger.Backend, level logger.Level)

SetLogger uses a specified Logger to output package logging info

func (*RPCClient) SetTimeout

func (c *RPCClient) SetTimeout(timeout time.Duration)

SetTimeout sets the timeout by which to wait for RPC responses

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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