Documentation
¶
Overview ¶
Package Node contains node logic.
Index ¶
- type Mode
- type Node
- func (n *Node) AddPeer(group state.GroupID, id state.PeerID)
- func (n *Node) AppendMessage(group state.GroupID, data []byte) (state.MessageID, error)
- func (n Node) IsPeerInGroup(g state.GroupID, p state.PeerID) bool
- func (n *Node) RequestMessage(group state.GroupID, id state.MessageID) error
- func (n *Node) Start()
- func (n *Node) Stop()
- func (n *Node) Subscribe(sub chan<- protobuf.Message)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
Node represents an MVDS node, it runs all the logic like sending and receiving protocol messages.
func NewNode ¶
func NewNode( ms store.MessageStore, st transport.Transport, ss state.SyncState, nextEpoch calculateNextEpoch, currentEpoch int64, id state.PeerID, mode Mode, ) *Node
NewNode returns a new node.
func (*Node) AppendMessage ¶
AppendMessage sends a message to a given group.
func (Node) IsPeerInGroup ¶
IsPeerInGroup checks whether a peer is in the specified group.
func (*Node) RequestMessage ¶ added in v0.0.18
RequestMessage adds a REQUEST record to the next payload for a given message ID.
func (*Node) Start ¶ added in v0.0.14
func (n *Node) Start()
Start listens for new messages received by the node and sends out those required every epoch.
Click to show internal directories.
Click to hide internal directories.