Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetLocalPeer ¶
func SetLocalPeer(peer *Peer)
Types ¶
type PeerManager ¶
type PeerManager struct {
// contains filtered or unexported fields
}
PeerManager controls the behavior of peers and establishes a relationship with the database.
func NewPeerManager ¶
func NewPeerManager(db *leveldb.Db) *PeerManager
NewPeerManager creates new peer manager.
func (*PeerManager) Disable ¶
func (pm *PeerManager) Disable(p Peer) error
Disable sets peer inactive.
func (*PeerManager) DisablerStart ¶
func (pm *PeerManager) DisablerStart()
DisablerStart starts cycle for disable peers who stopped responding.
func (*PeerManager) Exist ¶
func (pm *PeerManager) Exist(p Peer) bool
Exist checks if peer exist in peer list.
func (*PeerManager) Random ¶
func (pm *PeerManager) Random(count int) []Peer
Random gets count random peers.
Click to show internal directories.
Click to hide internal directories.