Documentation ¶
Overview ¶
Package brokerc provides functionality to create a Broker Client
Index ¶
- type Client
- func (c *Client) Close()
- func (c *Client) Connect() (err error)
- func (c *Client) SetCanConnectHandler(handler udpc.CanConnect)
- func (c *Client) SetCanReconnectHandler(handler udpc.CanReconnect)
- func (c *Client) SetConnectedHandler(handler udpc.ConnectedHandler)
- func (c *Client) SetConnectionHandler(handler p2pc.ConnectionHandler)
- func (c *Client) SetDisconnectedHandler(handler udpc.DisconnectedHandler)
- func (c *Client) SetMessageStreamHandler(handler p2pc.MessageStreamHandler)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // Connect to peer by ID ConnectPeerById func(peerId string, mode p2p.ConnectionMode) (conn *p2pc.Connection, err error) // Connect to peer by Tag ConnectPeerByTag func(tag string, mode p2p.ConnectionMode) (conn *p2pc.Connection, err error) // Client exit channel Exit chan bool // contains filtered or unexported fields }
Broker Client
func New ¶
func New( config Config, streamHandler udp.StreamHandler, ) (c *Client, err error)
Create Client
func (*Client) SetCanConnectHandler ¶
func (c *Client) SetCanConnectHandler(handler udpc.CanConnect)
Set CanConnect Handler
func (*Client) SetCanReconnectHandler ¶
func (c *Client) SetCanReconnectHandler(handler udpc.CanReconnect)
Set CanReconnect Handler
func (*Client) SetConnectedHandler ¶
func (c *Client) SetConnectedHandler(handler udpc.ConnectedHandler)
Set Connected Handler
func (*Client) SetConnectionHandler ¶
func (c *Client) SetConnectionHandler(handler p2pc.ConnectionHandler)
Set New Connection Handler
func (*Client) SetDisconnectedHandler ¶
func (c *Client) SetDisconnectedHandler(handler udpc.DisconnectedHandler)
Set Disconnected Handler
func (*Client) SetMessageStreamHandler ¶
func (c *Client) SetMessageStreamHandler(handler p2pc.MessageStreamHandler)
Set Message Stream Handler
Click to show internal directories.
Click to hide internal directories.