Documentation ¶
Index ¶
- type AddrTuple
- type Mock
- func (m *Mock) AddPeers(ctx context.Context, addr ...swarm.Address) error
- func (m *Mock) Close() error
- func (m *Mock) ClosestPeer(addr swarm.Address, skipPeers ...swarm.Address) (peerAddr swarm.Address, err error)
- func (m *Mock) Connected(_ context.Context, addr swarm.Address) error
- func (m *Mock) Disconnected(_ swarm.Address)
- func (m *Mock) EachPeer(f topology.EachPeerFunc) error
- func (m *Mock) EachPeerRev(f topology.EachPeerFunc) error
- func (m *Mock) NeighborhoodDepth() uint8
- func (m *Mock) ResetPeers()
- func (m *Mock) SubscribePeersChange() (c <-chan struct{}, unsubscribe func())
- 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) ClosestPeer ¶
func (*Mock) Disconnected ¶
Disconnected is called when a peer disconnects.
func (*Mock) EachPeer ¶
func (m *Mock) EachPeer(f topology.EachPeerFunc) error
EachPeer iterates from closest bin to farthest
func (*Mock) EachPeerRev ¶
func (m *Mock) EachPeerRev(f topology.EachPeerFunc) error
EachPeerRev iterates from farthest bin to closest
func (*Mock) NeighborhoodDepth ¶
func (*Mock) ResetPeers ¶
func (m *Mock) ResetPeers()
func (*Mock) SubscribePeersChange ¶
func (m *Mock) SubscribePeersChange() (c <-chan struct{}, unsubscribe func())
Click to show internal directories.
Click to hide internal directories.