Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GRPCClient ¶
type GRPCClient struct {
// contains filtered or unexported fields
}
GRPCClient is a gRPC-based RPC client
func Connect ¶
func Connect(address string) (*GRPCClient, error)
Connect connects to the RPC server with the given address
func (*GRPCClient) AttachRouter ¶
func (c *GRPCClient) AttachRouter(router *routerpkg.Router)
AttachRouter attaches the given router to the client and starts sending/receiving messages via it
func (*GRPCClient) Close ¶
func (c *GRPCClient) Close() error
Close closes the underlying grpc connection
func (*GRPCClient) Disconnect ¶
func (c *GRPCClient) Disconnect() error
Disconnect disconnects from the RPC server
func (*GRPCClient) SetOnDisconnectedHandler ¶
func (c *GRPCClient) SetOnDisconnectedHandler(onDisconnectedHandler OnDisconnectedHandler)
SetOnDisconnectedHandler sets the client's onDisconnectedHandler
func (*GRPCClient) SetOnErrorHandler ¶
func (c *GRPCClient) SetOnErrorHandler(onErrorHandler OnErrorHandler)
SetOnErrorHandler sets the client's onErrorHandler
type OnDisconnectedHandler ¶
type OnDisconnectedHandler func()
OnDisconnectedHandler defines a handler function for when the client disconnected
type OnErrorHandler ¶
type OnErrorHandler func(err error)
OnErrorHandler defines a handler function for when errors occur
Click to show internal directories.
Click to hide internal directories.