routing

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2018 License: Apache-2.0 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) ResolveS

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

ResolveS ShortID -> NodeID, Address for node inside current globe.

Jump to

Keyboard shortcuts

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