Documentation ¶
Index ¶
- type PSlice
- func (s *PSlice) Add(addrs ...boson.Address)
- func (s *PSlice) BinPeers(bin uint8) []boson.Address
- func (s *PSlice) BinSize(bin uint8) int
- func (s *PSlice) EachBin(pf model.EachPeerFunc) error
- func (s *PSlice) EachBinRev(pf model.EachPeerFunc) error
- func (s *PSlice) Exists(addr boson.Address) bool
- func (s *PSlice) Length() int
- func (s *PSlice) Remove(addr boson.Address)
- func (s *PSlice) ShallowestEmpty() (uint8, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type PSlice ¶
type PSlice struct {
// contains filtered or unexported fields
}
PSlice maintains a list of addresses, indexing them by their different proximity orders.
func (*PSlice) EachBin ¶
func (s *PSlice) EachBin(pf model.EachPeerFunc) error
iterates over all peers from deepest bin to shallowest.
func (*PSlice) EachBinRev ¶
func (s *PSlice) EachBinRev(pf model.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.