tests

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: 3 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
}

func NewCluster

func NewCluster() *Cluster

func (*Cluster) AddNode

func (c *Cluster) AddNode(nodeSub *NodeSubscriber) (*scuttlebutt.Scuttlebutt, error)

func (*Cluster) RemoveNode

func (c *Cluster) RemoveNode(addr string)

func (*Cluster) Seeds

func (c *Cluster) Seeds() []string

func (*Cluster) Shutdown

func (c *Cluster) Shutdown() error

type NodeSubscriber

type NodeSubscriber struct {
	PeerJoinedCh  chan string
	PeerLeftCh    chan string
	PeerUpdatedCh chan peerUpdate
}

func NewNodeSubscriber

func NewNodeSubscriber() *NodeSubscriber

func (*NodeSubscriber) OnJoin

func (e *NodeSubscriber) OnJoin(addr string)

func (*NodeSubscriber) OnLeave

func (e *NodeSubscriber) OnLeave(addr string)

func (*NodeSubscriber) OnUpdate

func (e *NodeSubscriber) OnUpdate(addr string, key string, value string)

func (*NodeSubscriber) WaitPeerJoinedWithTimeout

func (s *NodeSubscriber) WaitPeerJoinedWithTimeout(t time.Duration) (string, bool)

func (*NodeSubscriber) WaitPeerLeftWithTimeout

func (s *NodeSubscriber) WaitPeerLeftWithTimeout(t time.Duration) (string, bool)

func (*NodeSubscriber) WaitPeerUpdatedWithTimeout

func (s *NodeSubscriber) WaitPeerUpdatedWithTimeout(t time.Duration) (peerUpdate, bool)

Jump to

Keyboard shortcuts

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