Documentation ¶
Index ¶
- type AddrTuple
- type Mock
- func (m *Mock) AddPeers(addr ...swarm.Address)
- func (m *Mock) AddRevPeers(addrs ...AddrTuple)
- func (m *Mock) Announce(_ context.Context, _ swarm.Address, _ bool) error
- func (m *Mock) AnnounceTo(_ context.Context, _, _ swarm.Address, _ bool) error
- func (m *Mock) Close() error
- func (m *Mock) ClosestPeer(addr swarm.Address, _ bool, _ topology.Select, skipPeers ...swarm.Address) (peerAddr swarm.Address, err error)
- func (m *Mock) Connected(_ context.Context, peer p2p.Peer, _ bool) error
- func (m *Mock) Disconnected(peer p2p.Peer)
- func (m *Mock) EachConnectedPeer(f topology.EachPeerFunc, _ topology.Select) error
- func (m *Mock) EachConnectedPeerRev(f topology.EachPeerFunc, _ topology.Select) error
- func (m *Mock) EachNeighbor(topology.EachPeerFunc) error
- func (m *Mock) EachNeighborRev(topology.EachPeerFunc) error
- func (d *Mock) Halt()
- func (m *Mock) IsReachable() bool
- func (m *Mock) NeighborhoodDepth() uint8
- func (m *Mock) ResetPeers()
- func (m *Mock) SetStorageRadius(uint8)
- func (m *Mock) Snapshot() *topology.KadParams
- func (m *Mock) SubscribeTopologyChange() (c <-chan struct{}, unsubscribe func())
- func (m *Mock) Trigger()
- func (m *Mock) UpdatePeerHealth(swarm.Address, bool, time.Duration)
- 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) AddRevPeers ¶
func (*Mock) AnnounceTo ¶
func (*Mock) ClosestPeer ¶
func (*Mock) Disconnected ¶
Disconnected is called when a peer disconnects.
func (*Mock) EachConnectedPeer ¶
EachConnectedPeer iterates from closest bin to farthest
func (*Mock) EachConnectedPeerRev ¶
EachPeerRev iterates from farthest bin to closest
func (*Mock) EachNeighbor ¶
func (m *Mock) EachNeighbor(topology.EachPeerFunc) error
func (*Mock) EachNeighborRev ¶
func (m *Mock) EachNeighborRev(topology.EachPeerFunc) error
func (*Mock) IsReachable ¶
func (*Mock) NeighborhoodDepth ¶
func (*Mock) ResetPeers ¶
func (m *Mock) ResetPeers()
func (*Mock) SetStorageRadius ¶
PeerIterator iterates from closest bin to farthest
func (*Mock) SubscribeTopologyChange ¶
func (m *Mock) SubscribeTopologyChange() (c <-chan struct{}, unsubscribe func())
Click to show internal directories.
Click to hide internal directories.