Documentation ¶
Overview ¶
Package messages allows for encoding and decoding messages to broadcast over gossip.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Message ¶
type Message interface { // Type returns the Type of the message. Type must be a known, valid type. Type() Type // Invalidates should return true if this message takes precedence over m. Invalidates(m Message) bool // Cache should return true if this Message should be cached into the local // state. Messages in the local state will be synchronized with peers over // time, and is useful for anti-entropy. Cache() bool }
Message is a payload that can be gossiped to other peers.
type State ¶
type State struct { // Name of the node this state change is for. NodeName string // New State of the node. NewState peer.State // Time the state was generated. Time lamport.Time }
State represents a State change broadcast from a node.
func (*State) Invalidates ¶
Invalidates implements Message.
type Type ¶
type Type uint8
Type of the message. Encoded along with the payload to be able to determine what message was sent during decoding.
const ( TypeInvalid Type = iota // TypeInvalid is an invalid type. TypeState // TypeState is used for a State broadcast )
Types for messages.
Click to show internal directories.
Click to hide internal directories.