Documentation ¶
Index ¶
Constants ¶
View Source
const (
IPv4PrefixLength = 24
)
IPV4 Prefix Length of the IP network
Variables ¶
View Source
var ( ErrHostExists = errors.New("storage host existed in the tree already") ErrHostNotExists = errors.New("storage host cannot be found from the tree") ErrEvaluationTooLarge = errors.New("provided evaluation must be less than the total evaluation of the tree") ErrNodeNotOccupied = errors.New("node returned is not occupied") )
Definition of common error messages
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter defines IP filter map. For any IP addresses with same IP Network will be marked and filter needed. IP address can be extracted from the enode information
type StorageHostTree ¶
type StorageHostTree interface { Insert(hi storage.HostInfo, eval int64) error HostInfoUpdate(hi storage.HostInfo, eval int64) error Remove(enodeID enode.ID) error All() []storage.HostInfo RetrieveHostInfo(enodeID enode.ID) (storage.HostInfo, bool) RetrieveHostEval(enodeID enode.ID) (int64, bool) SelectRandom(needed int, blacklist, addrBlacklist []enode.ID) []storage.HostInfo }
StorageHostTree is the interface for storageHostTree which stores the host info in a tree structure
Click to show internal directories.
Click to hide internal directories.