Versions in this module Expand all Collapse all v0 v0.5.4 Sep 24, 2020 Changes in this version + var ErrManagerIsShutdown = errors.New("peering manager is shutdown") + var ErrNonMatchingCooAddr = errors.New("used coo addr doesn't match") + var ErrNonMatchingMWM = errors.New("used MWM doesn't match") + var ErrNonMatchingSrvSocketPort = errors.New("advertised server socket port doesn't match") + var ErrPeerAlreadyConnected = errors.New("peer is already connected") + var ErrPeerAlreadyInReconnect = errors.New("peer is already in the reconnect pool") + var ErrPeeringSlotsFilled = errors.New("peering slots filled") + var ErrUnknownPeerID = errors.New("peer ID is not known") + type Events struct + AutopeeredPeerBecameStatic *events.Event + AutopeeredPeerHandshaking *events.Event + ConnectedAutopeeredPeer *events.Event + Error *events.Event + IPLookupError *events.Event + PeerConnected *events.Event + PeerDisconnected *events.Event + PeerHandshakingIncoming *events.Event + PeerHandshakingOutgoing *events.Event + PeerMovedFromConnectedToReconnectPool *events.Event + PeerMovedIntoReconnectPool *events.Event + PeerRemovedFromReconnectPool *events.Event + ReconnectRemovedAlreadyConnected *events.Event + Reconnecting *events.Event + Shutdown *events.Event + type Manager struct + Events Events + Opts Options + func NewManager(opts Options, peers ...*config.PeerConfig) *Manager + func (m *Manager) Add(addr string, preferIPv6 bool, alias string, autoPeer ...*autopeering.Peer) error + func (m *Manager) AnySTINGPeerConnected() bool + func (m *Manager) Blacklist(ip string) + func (m *Manager) BlacklistRemove(ip string) + func (m *Manager) Blacklisted(ip string) bool + func (m *Manager) ConnectedAndSyncedPeerCount() (uint8, uint8) + func (m *Manager) ConnectedPeerCount() int + func (m *Manager) ForAll(f PeerConsumerFunc) + func (m *Manager) ForAllConnected(f PeerConsumerFunc) + func (m *Manager) IsStaticallyPeered(ips []string, port uint16) bool + func (m *Manager) Listen() error + func (m *Manager) PeerCount() int + func (m *Manager) PeerInfos() []*peer.Info + func (m *Manager) Reconnect() + func (m *Manager) Remove(id string) error + func (m *Manager) SetupEventHandlers(p *peer.Peer) + func (m *Manager) Shutdown() + func (m *Manager) SlotsFilled() bool + func (m *Manager) Whitelist(ips []string, port uint16, autopeeringPeer ...*autopeering.Peer) + func (m *Manager) WhitelistRemove(id string) + func (m *Manager) Whitelisted(id string) (*autopeering.Peer, bool) + type Options struct + AcceptAnyPeer bool + BindAddress string + MaxConnected int + ValidHandshake handshake.Handshake + type PeerConsumerFunc func(p *peer.Peer) bool