Versions in this module Expand all Collapse all v1 v1.0.1 Mar 1, 2020 Changes in this version + const IPv4PrefixLength + var ErrEvaluationTooLarge = errors.New("provided evaluation must be less than the total evaluation of the tree") + var ErrHostExists = errors.New("storage host existed in the tree already") + var ErrHostNotExists = errors.New("storage host cannot be found from the tree") + var ErrNodeNotOccupied = errors.New("node returned is not occupied") + func IPNetwork(ip string) (ipnet *net.IPNet, err error) + type Filter struct + func NewFilter() *Filter + func (f *Filter) Add(ip string) + func (f *Filter) Filtered(ip string) bool + func (f *Filter) Reset() + type StorageHostTree interface + All func() []storage.HostInfo + HostInfoUpdate func(hi storage.HostInfo, eval int64) error + Insert func(hi storage.HostInfo, eval int64) error + Remove func(enodeID enode.ID) error + RetrieveHostEval func(enodeID enode.ID) (int64, bool) + RetrieveHostInfo func(enodeID enode.ID) (storage.HostInfo, bool) + SelectRandom func(needed int, blacklist, addrBlacklist []enode.ID) []storage.HostInfo + func New() StorageHostTree