gobrpc

package
v1.3.7 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: Apache-2.0 Imports: 8 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRawClient

func NewRawClient(network, address string, connTimeout time.Duration) (*rpc.Client, error)

Types

type Clients

type Clients struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewClients

func NewClients(addresses []string, callTimeout time.Duration) *Clients

func (*Clients) Call

func (cs *Clients) Call(method string, args, reply interface{}, callTimeout time.Duration) error

func (*Clients) GetClient

func (cs *Clients) GetClient(addr string) (*RPCClient, bool)

func (*Clients) PutClient

func (cs *Clients) PutClient(addr string, client *RPCClient)

func (*Clients) SetClients

func (cs *Clients) SetClients(clients map[string]*RPCClient)

type RPCClient

type RPCClient struct {
	// contains filtered or unexported fields
}

func NewRPCClient

func NewRPCClient(address string, rpcClient *rpc.Client, callTimeout time.Duration) *RPCClient

func (*RPCClient) Call

func (c *RPCClient) Call(method string, args interface{}, reply interface{}, callTimeout ...time.Duration) error

func (*RPCClient) Close

func (c *RPCClient) Close()

func (*RPCClient) IsClose

func (c *RPCClient) IsClose() bool

Jump to

Keyboard shortcuts

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