node

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2019 License: MIT Imports: 10 Imported by: 2 modules, 3 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mode

type Mode string
const (
	INTERACTIVE Mode = "interactive"
	BATCH       Mode = "batch"
)

type Node

type Node struct {
	ID state.PeerID
	// contains filtered or unexported fields
}

func NewNode

func NewNode(ms store.MessageStore, st transport.Transport, ss state.SyncState, nextEpoch calculateNextEpoch, id state.PeerID, mode Mode) *Node

func (*Node) AddPeer

func (n *Node) AddPeer(group state.GroupID, id state.PeerID)

AddPeer adds a peer to a specific group making it a recipient of messages

func (*Node) AppendMessage

func (n *Node) AppendMessage(group state.GroupID, data []byte) (state.MessageID, error)

AppendMessage sends a message to a given group.

func (Node) IsPeerInGroup

func (n Node) IsPeerInGroup(g state.GroupID, p state.PeerID) bool

func (*Node) Run

func (n *Node) Run()

Run listens for new messages received by the node and sends out those required every epoch.

Jump to

Keyboard shortcuts

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