Documentation ¶
Index ¶
- type PSlice
- func (s *PSlice) Add(addr swarm.Address, po uint8)
- func (s *PSlice) EachBin(pf topology.EachPeerFunc) error
- func (s *PSlice) EachBinRev(pf topology.EachPeerFunc) error
- func (s *PSlice) Exists(addr swarm.Address) bool
- func (s *PSlice) Length() int
- func (s *PSlice) Remove(addr swarm.Address, po uint8)
- func (s *PSlice) ShallowestEmpty() (bin uint8, none bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PSlice ¶
PSlice maintains a list of addresses, indexing them by their different proximity orders. Currently, when peers are added or removed, their proximity order must be supplied, this is in order to reduce duplicate PO calculation which is normally known and already needed in the calling context.
func (*PSlice) EachBin ¶
func (s *PSlice) EachBin(pf topology.EachPeerFunc) error
iterates over all peers from deepest bin to shallowest.
func (*PSlice) EachBinRev ¶
func (s *PSlice) EachBinRev(pf topology.EachPeerFunc) error
EachBinRev iterates over all peers from shallowest bin to deepest.
func (*PSlice) ShallowestEmpty ¶
ShallowestEmpty returns the shallowest empty bin if one exists. If such bin does not exists, returns true as bool value.
Click to show internal directories.
Click to hide internal directories.