routing

package
v0.8.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2019 License: Apache-2.0, BSD-3-Clause-Clear Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Table

type Table struct {
	NodeKeeper network.NodeKeeper
}

func (*Table) AddToKnownHosts

func (t *Table) AddToKnownHosts(h *host.Host)

AddToKnownHosts add host to routing table.

func (*Table) GetRandomNodes

func (t *Table) GetRandomNodes(count int) []host.Host

GetRandomNodes get a specified number of random nodes. Returns less if there are not enough nodes in network.

func (*Table) Inject

func (t *Table) Inject(nodeKeeper network.NodeKeeper)

func (*Table) Rebalance

func (t *Table) Rebalance(network.PartitionPolicy)

Rebalance recreate shards of routing table with known hosts according to new partition policy.

func (*Table) Resolve

func (t *Table) Resolve(ref core.RecordRef) (*host.Host, error)

Resolve NodeID -> ShortID, Address. Can initiate network requests.

func (*Table) ResolveConsensus added in v0.8.0

func (t *Table) ResolveConsensus(id core.ShortNodeID) (*host.Host, error)

func (*Table) ResolveConsensusRef added in v0.8.0

func (t *Table) ResolveConsensusRef(ref core.RecordRef) (*host.Host, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL