Documentation ¶
Index ¶
- type HostDB
- func (hdb *HostDB) FlagHost(id string) error
- func (hdb *HostDB) Info() ([]byte, error)
- func (hdb *HostDB) Insert(entry components.HostEntry) error
- func (hdb *HostDB) RandomHost() (h components.HostEntry, err error)
- func (hdb *HostDB) Remove(id string) error
- func (hdb *HostDB) Size() int
- func (hdb *HostDB) Update(initialStateHeight consensus.BlockHeight, rewoundBlocks []consensus.Block, ...) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostDB ¶
type HostDB struct {
// contains filtered or unexported fields
}
The HostDB is a set of hosts that get weighted and inserted into a tree
func (*HostDB) Insert ¶
func (hdb *HostDB) Insert(entry components.HostEntry) error
Insert adds an entry to the hostdb, wrapping the standard insert call with a lock. When called externally, the lock needs to be in place, however sometimes insert needs to be called internally when there is already a lock in place.
func (*HostDB) RandomHost ¶
func (hdb *HostDB) RandomHost() (h components.HostEntry, err error)
RandomHost pulls a random host from the hostdb weighted according to whatever internal metrics exist within the hostdb.
Click to show internal directories.
Click to hide internal directories.