Documentation ¶
Index ¶
- Variables
- func FormatIPv4(ipv4 uint32) string
- func GenCircularGraphPair(k, r int) (*Graph, *Graph)
- func MustParseIPv4(host string) uint32
- func PackIPv4(ip net.IP) uint32
- func ParseIPv4(host string) (uint32, error)
- type Addr
- type Config
- type Graph
- type HostList
- type HostSpec
- type Interval
- type NetAddr
- type Node
- type PeerID
- type PeerList
- func (pl PeerList) Bytes() []byte
- func (pl PeerList) Diff(ql PeerList) (PeerList, PeerList)
- func (pl PeerList) Eq(ql PeerList) bool
- func (pl PeerList) LocalRank(ps PeerID) (int, bool)
- func (pl PeerList) Lookup(ps PeerID) (int, bool)
- func (pl PeerList) On(host uint32) PeerList
- func (pl PeerList) Set() map[PeerID]struct{}
- func (pl PeerList) String() string
- type PortRange
- type Vertices
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultHostList = HostList{ { IPv4: MustParseIPv4(`127.0.0.1`), Slots: runtime.NumCPU(), PublicAddr: `127.0.0.1`, }, }
View Source
var DefaultPortRange = PortRange{
Begin: 10000,
End: 11000,
}
View Source
var ErrInvalidHostSpec = errors.New("Invalid HostSpec")
Functions ¶
func FormatIPv4 ¶
func GenCircularGraphPair ¶
func MustParseIPv4 ¶
Types ¶
type Config ¶ added in v0.2.0
type Config struct { Parent PeerID Parents PeerList Self PeerID Strategy kb.Strategy InitCheckpoint string InitPeers PeerList // resources HostList HostList PortRange PortRange Single bool }
func ParseConfigFromEnv ¶ added in v0.2.0
type Graph ¶
type Graph struct {
Nodes []Node
}
func GenBinaryTree ¶
func GenBinaryTreeStar ¶
func GenDefaultReduceGraph ¶
func GenStarBcastGraph ¶
GenStarBcastGraph generates a star shape graph with k vertices and centered at vertice r (0 <= r < k)
func (Graph) IsSelfLoop ¶
type Interval ¶
Interval represents the interval of integers [Begin, End)
func EvenPartition ¶
EvenPartition parts an Interval into k parts such that the length of each part differ at most 1
type PeerID ¶
type PeerID NetAddr
PeerID is the unique identifier of a peer.
func (PeerID) ColocatedWith ¶
Click to show internal directories.
Click to hide internal directories.