Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnectCallback ¶
type Network ¶
type Network interface { // Start start the network service. Start() error // Stop stop the network service. Stop() error // Connect connects peer by ID. Connect(ID) error // Disconnect peer with id Disconnect(ID) error // SetConnectionCallback Sets the callback after connecting SetConnectCallback(ConnectCallback) // Send message to peer with peer info. Send(ID, *proto.Message) error // Send message using existed stream SendWithStream(s network.Stream, msg *proto.Message) error // Sync Send message SyncSend(ID, *proto.Message) (*proto.Message, error) // Broadcast message to all node Broadcast([]ID, *proto.Message) error // Receive message from the channel Receive() <-chan *MessageStream // IDStore IDStore() IDStore }
type OnConnectCallback ¶
Click to show internal directories.
Click to hide internal directories.