Versions in this module Expand all Collapse all v1 v1.999.10 Nov 28, 2022 Changes in this version + var ErrNilNetwork = errors.New("nil network") + var ErrNotConnectedToNetwork = errors.New("not connected to network") + var ErrReceivingPeerNotConnected = errors.New("receiving peer not connected to network") + type Messenger struct + func NewMessenger(network *Network) (*Messenger, error) + func (messenger *Messenger) Addresses() []string + func (messenger *Messenger) Bootstrap(_ uint32) error + func (messenger *Messenger) Broadcast(topic string, buff []byte) + func (messenger *Messenger) BroadcastOnChannel(_ string, topic string, buff []byte) + func (messenger *Messenger) BroadcastOnChannelBlocking(_ string, topic string, buff []byte) error + func (messenger *Messenger) Close() error + func (messenger *Messenger) ConnectToPeer(_ string) error + func (messenger *Messenger) ConnectedAddresses() []string + func (messenger *Messenger) ConnectedPeers() []core.PeerID + func (messenger *Messenger) ConnectedPeersOnTopic(topic string) []core.PeerID + func (messenger *Messenger) CreateTopic(name string, _ bool) error + func (messenger *Messenger) GetConnectedPeersInfo() *p2p.ConnectedPeersInfo + func (messenger *Messenger) HasTopic(name string) bool + func (messenger *Messenger) ID() core.PeerID + func (messenger *Messenger) IsConnected(_ core.PeerID) bool + func (messenger *Messenger) IsConnectedToNetwork() bool + func (messenger *Messenger) IsConnectedToTheNetwork() bool + func (messenger *Messenger) IsInterfaceNil() bool + func (messenger *Messenger) NumMessagesReceived() uint64 + func (messenger *Messenger) OutgoingChannelLoadBalancer() p2p.ChannelLoadBalancer + func (messenger *Messenger) PeerAddresses(pid core.PeerID) []string + func (messenger *Messenger) Peers() []core.PeerID + func (messenger *Messenger) RegisterMessageProcessor(topic string, _ string, handler p2p.MessageProcessor) error + func (messenger *Messenger) SendToConnectedPeer(topic string, buff []byte, peerID core.PeerID) error + func (messenger *Messenger) SetPeerDenialEvaluator(_ p2p.PeerDenialEvaluator) error + func (messenger *Messenger) SetPeerShardResolver(_ p2p.PeerShardResolver) error + func (messenger *Messenger) SetThresholdMinConnectedPeers(_ int) error + func (messenger *Messenger) ThresholdMinConnectedPeers() int + func (messenger *Messenger) TrimConnections() + func (messenger *Messenger) UnregisterMessageProcessor(topic string, _ string) error + type Network struct + func NewNetwork() *Network + func (network *Network) IsPeerConnected(peerID core.PeerID) bool + func (network *Network) ListAddressesExceptOne(peerIDToExclude core.PeerID) []string + func (network *Network) PeerIDs() []core.PeerID + func (network *Network) PeerIDsExceptOne(peerIDToExclude core.PeerID) []core.PeerID + func (network *Network) Peers() map[core.PeerID]*Messenger + func (network *Network) PeersExceptOne(peerIDToExclude core.PeerID) map[core.PeerID]*Messenger + func (network *Network) RegisterPeer(messenger *Messenger) + func (network *Network) UnregisterPeer(peerID core.PeerID)