cluster

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cluster

type Cluster struct {
	// contains filtered or unexported fields
}

Cluster manages a local cluster used for testing and evaluation.

func NewCluster

func NewCluster() *Cluster

func (*Cluster) AddNode

func (c *Cluster) AddNode() (*Node, error)

func (*Cluster) AddNodes

func (c *Cluster) AddNodes(n int) error

func (*Cluster) WaitForHealthy

func (c *Cluster) WaitForHealthy(ctx context.Context) error

WaitForHealthy waits for all nodes to discovery each other.

func (*Cluster) WaitToDiscover

func (c *Cluster) WaitToDiscover(ctx context.Context, nodeAddr string) error

WaitToDiscover waits for all nodes to be notified about the node with the given addr joining the cluster.

func (*Cluster) WaitToUpdate

func (c *Cluster) WaitToUpdate(ctx context.Context, nodeAddr string, key string, value string) error

WaitToUpdate waits for all nodes to be notified about the given update.

type Node

type Node struct {
	Gossiper *scuttlebutt.Scuttlebutt
}

func (*Node) DiscoveredNode

func (n *Node) DiscoveredNode(nodeAddr string) bool

func (*Node) KnownPeers

func (n *Node) KnownPeers() int

func (*Node) ReceivedUpdate

func (n *Node) ReceivedUpdate(nodeAddr string, key string, value string) bool

Jump to

Keyboard shortcuts

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