Documentation
¶
Index ¶
Constants ¶
View Source
const ( // NOCALLBACK is callback type for messages without callback NOCALLBACK = callback.NOCALLBACK )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BMMC ¶ added in v0.3.0
type BMMC struct {
// contains filtered or unexported fields
}
BMMC is the bimodal multicast protocol
func (*BMMC) AddMessage ¶ added in v0.3.0
AddMessage adds new message in messages buffer.
func (*BMMC) GetMessages ¶ added in v0.3.0
func (b *BMMC) GetMessages() []interface{}
GetMessages returns a slice with all messages from messages buffer
func (*BMMC) RemovePeer ¶ added in v0.3.0
RemovePeer removes given peer from peers buffer
type Config ¶
type Config struct { // Addr is HTTP address for node which runs http servers // Required Addr string // Port is HTTP port for node which runs http servers // Required Port string // Beta is the expected fanout for gossip rounds // Optional Beta float64 // Logger // Optional Logger *log.Logger // Callbacks funtions // Optional Callbacks map[string]func(interface{}, *log.Logger) error // Gossip round duration // Optional RoundDuration time.Duration }
Config is the config for the protocol
type GossipRound ¶ added in v0.3.0
GossipRound is the number of gossiper rounds
func NewGossipRound ¶ added in v0.3.0
func NewGossipRound() *GossipRound
NewGossipRound creates new GossipRound
func (*GossipRound) GetNumber ¶ added in v0.3.0
func (r *GossipRound) GetNumber() int64
GetNumber returns the gossip round numbers
func (*GossipRound) Increment ¶ added in v0.3.0
func (r *GossipRound) Increment()
Increment increments the gossip round numbers
type HTTPGossip ¶ added in v0.3.0
type HTTPGossip struct { Addr string `json:"addr"` Port string `json:"port"` RoundNumber *GossipRound `json:"roundNumber"` Digests buffer.DigestBuffer `json:"digests"` }
HTTPGossip is gossip message for http server
type HTTPSolicitation ¶ added in v0.3.0
type HTTPSolicitation struct { Addr string `json:"addr"` Port string `json:"port"` RoundNumber *GossipRound `json:"roundNumber"` Digests buffer.DigestBuffer `json:"digests"` }
HTTPSolicitation is solicitation message for http server
type HTTPSynchronization ¶ added in v0.3.0
type HTTPSynchronization struct { Addr string `json:"addr"` Port string `json:"port"` Messages buffer.MessageBuffer `json:"messages"` }
HTTPSynchronization is synchronization message for http server
Click to show internal directories.
Click to hide internal directories.