Documentation
¶
Index ¶
- Constants
- type Node
- type PeerCallback
- type PeerManager
- func (pm *PeerManager) Add(p peer.ID) bool
- func (pm *PeerManager) Count() int
- func (pm *PeerManager) Has(p peer.ID) bool
- func (pm *PeerManager) IsFull() bool
- func (pm *PeerManager) List() []peer.ID
- func (pm *PeerManager) ParsePeer(peerID string) (peer.ID, error)
- func (pm *PeerManager) Remove(p peer.ID)
- func (pm *PeerManager) SetCallback(cb PeerCallback)
- type Protocol
Constants ¶
View Source
const ( // LowWater is the minimum number of connections to maintain (D_lo) LowWater = 4 // HighWater is the maximum number of connections (D_hi) HighWater = 8 // GracePeriod is how long to wait before pruning connections GracePeriod = 0 )
Connection limits matching GossipSub mesh parameters
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct {
// contains filtered or unexported fields
}
func (*Node) PeerManager ¶
func (n *Node) PeerManager() *PeerManager
func (*Node) SetProtocol ¶
type PeerCallback ¶
PeerCallback is called when a peer connects or disconnects
type PeerManager ¶
type PeerManager struct {
// contains filtered or unexported fields
}
func NewPeerManager ¶
func NewPeerManager(maxPeers int) *PeerManager
func (*PeerManager) Count ¶
func (pm *PeerManager) Count() int
func (*PeerManager) IsFull ¶
func (pm *PeerManager) IsFull() bool
func (*PeerManager) List ¶
func (pm *PeerManager) List() []peer.ID
func (*PeerManager) ParsePeer ¶ added in v1.1.0
func (pm *PeerManager) ParsePeer(peerID string) (peer.ID, error)
func (*PeerManager) Remove ¶
func (pm *PeerManager) Remove(p peer.ID)
func (*PeerManager) SetCallback ¶
func (pm *PeerManager) SetCallback(cb PeerCallback)
Click to show internal directories.
Click to hide internal directories.