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

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