manager

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2016 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AppendToList added in v0.2.0

func AppendToList(n *node.Node)

AppendToList add node n to nodelist if it is allowd and list doesn't have it.

func AppendToTable

func AppendToTable(datfile string, n *node.Node)

AppendToTable add node n to table if it is allowd and list doesn't have it.

func AppendToTableTX added in v0.2.0

func AppendToTableTX(tx *bolt.Tx, datfile string, n *node.Node)

AppendToTableTX add node n to table if it is allowd and list doesn't have it.

func Get

func Get(datfile string, def node.Slice) node.Slice

Get returns rawnodelist associated with datfile if not found returns def

func GetNodestrSlice

func GetNodestrSlice() []string

GetNodestrSlice returns Nodestr of all nodes.

func GetNodestrSliceInList added in v0.2.0

func GetNodestrSliceInList() []string

GetNodestrSliceInList returns Nodestr slice of nodes in list.

func GetNodestrSliceInTable

func GetNodestrSliceInTable(datfile string) []string

GetNodestrSliceInTable returns Nodestr slice of nodes associated datfile thread.

func Initialize

func Initialize(allnodes node.Slice)

Initialize pings one of initNode except myself and added it if success, and get another node info from each nodes in nodelist.

func Join

func Join(n *node.Node) bool

Join tells n to join and adds n to nodelist if welcomed. if n returns another nodes, repeats it and return true.. removes fron nodelist if not welcomed and return false.

func ListLen

func ListLen() int

ListLen returns size of nodelist.

func NodeLen

func NodeLen() int

NodeLen returns size of all nodes.

func NodesForGet

func NodesForGet(datfile string, searchDepth int) node.Slice

NodesForGet returns nodes which has datfile cache , and that extends nodes to #searchDepth .

func Random

func Random(exclude node.Slice, num int) []*node.Node

Random selects # of min(all # of nodes,n) nodes randomly except exclude nodes.

func RemoveFromAllTable

func RemoveFromAllTable(n *node.Node) bool

RemoveFromAllTable removes node n from all tables and return true if exists. or returns false if not exists.

func RemoveFromList

func RemoveFromList(n *node.Node) bool

RemoveFromList removes node n from nodelist and return true if exists. or returns false if not exists.

func RemoveFromTable

func RemoveFromTable(datfile string, n *node.Node) bool

RemoveFromTable removes node n and return true if exists. or returns false if not exists.

func ReplaceNodeInList

func ReplaceNodeInList(n *node.Node) *node.Node

ReplaceNodeInList removes one node and say bye to the node and add n in nodelist. if len(node)>defaultnode

func TellUpdate

func TellUpdate(datfile string, stamp int64, id string, n *node.Node)

TellUpdate makes mynode info from node or dnsname or ip addr, and broadcast the updates of record id=id in cache c.datfile with stamp.

Types

This section is empty.

Jump to

Keyboard shortcuts

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