Documentation ¶
Index ¶
- type AddrTuple
- type Mock
- func (m *Mock) AddPeers(addr ...boson.Address)
- func (m *Mock) Announce(_ context.Context, _ boson.Address, _ bool) error
- func (m *Mock) AnnounceTo(_ context.Context, _, _ boson.Address, _ bool) error
- func (m *Mock) Close() error
- func (m *Mock) ClosestPeer(addr boson.Address, _ bool, _ topology.Filter, skipPeers ...boson.Address) (peerAddr boson.Address, err error)
- func (m *Mock) ClosestPeers(addr boson.Address, limit int, _ topology.Filter, skipPeers ...boson.Address) ([]boson.Address, error)
- func (m *Mock) Connected(_ context.Context, peer p2p.Peer, _ bool) error
- func (m *Mock) DisconnectForce(addr boson.Address, reason string) error
- func (m *Mock) Disconnected(peer p2p.Peer, reason string)
- func (m *Mock) EachKnownPeer(peerFunc model.EachPeerFunc) error
- func (m *Mock) EachKnownPeerRev(peerFunc model.EachPeerFunc) error
- func (m *Mock) EachNeighbor(model.EachPeerFunc) error
- func (m *Mock) EachNeighborRev(model.EachPeerFunc) error
- func (m *Mock) EachPeer(f model.EachPeerFunc, _ topology.Filter) error
- func (m *Mock) EachPeerRev(f model.EachPeerFunc, _ topology.Filter) error
- func (m *Mock) GetPeersWithLatencyEWMA(list []boson.Address) (now []boson.Address)
- func (m *Mock) Halt()
- func (m *Mock) IsWithinDepth(_ boson.Address) bool
- func (m *Mock) NeighborhoodDepth() uint8
- func (m *Mock) NotifyPeerState(peer p2p.PeerInfo)
- func (m *Mock) Outbound(peer p2p.Peer)
- func (m *Mock) RecordPeerLatency(add boson.Address, t time.Duration)
- func (m *Mock) RefreshProtectPeer(peer []boson.Address)
- func (m *Mock) ResetPeers()
- func (m *Mock) Snapshot() *model.KadParams
- func (m *Mock) SnapshotAddr(addr boson.Address) *model.Snapshot
- func (m *Mock) SnapshotConnected() (connected int, peers map[string]*model.PeerInfo)
- func (m *Mock) SubscribePeerState(notifier subscribe.INotifier)
- func (m *Mock) SubscribePeersChange(notifier subscribe.INotifier)
- func (m *Mock) Trigger()
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mock ¶
type Mock struct {
// contains filtered or unexported fields
}
func NewMockKademlia ¶
func (*Mock) AddPeers ¶
AddPeers is called when a peers are added to the topology backlog for further processing by connectivity strategy.
func (*Mock) AnnounceTo ¶
func (*Mock) ClosestPeer ¶
func (*Mock) ClosestPeers ¶
func (*Mock) DisconnectForce ¶
func (*Mock) Disconnected ¶
Disconnected is called when a peer disconnects.
func (*Mock) EachKnownPeer ¶
func (m *Mock) EachKnownPeer(peerFunc model.EachPeerFunc) error
func (*Mock) EachKnownPeerRev ¶
func (m *Mock) EachKnownPeerRev(peerFunc model.EachPeerFunc) error
func (*Mock) EachNeighbor ¶
func (m *Mock) EachNeighbor(model.EachPeerFunc) error
func (*Mock) EachNeighborRev ¶
func (m *Mock) EachNeighborRev(model.EachPeerFunc) error
func (*Mock) EachPeerRev ¶
EachPeerRev iterates from farthest bin to closest
func (*Mock) GetPeersWithLatencyEWMA ¶ added in v1.4.1
func (*Mock) NeighborhoodDepth ¶
func (*Mock) NotifyPeerState ¶
func (*Mock) RecordPeerLatency ¶
func (*Mock) RefreshProtectPeer ¶
func (*Mock) ResetPeers ¶
func (m *Mock) ResetPeers()
func (*Mock) SnapshotConnected ¶
func (*Mock) SubscribePeerState ¶
func (*Mock) SubscribePeersChange ¶
Click to show internal directories.
Click to hide internal directories.