bmmc

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 18, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunWithSpec added in v0.1.3

func RunWithSpec(retries int,
	noPeers int,
	loss float64,
	beta float64,
	cbRegistry map[string]func(string, *log.Logger) (bool, error),
	cbType string,
	timeout time.Duration) error

Types

type Bmmc added in v0.1.2

type Bmmc struct {
	// contains filtered or unexported fields
}

func New

func New(cfg *Config) (*Bmmc, error)

New creates a new instance for the protocol

func (*Bmmc) AddMessage added in v0.1.2

func (b *Bmmc) AddMessage(msg, callbackType string)

func (*Bmmc) AddPeer added in v0.1.6

func (b *Bmmc) AddPeer(addr, port string)

func (*Bmmc) GetMessages added in v0.1.2

func (b *Bmmc) GetMessages() []string

func (*Bmmc) RemovePeer added in v0.1.6

func (b *Bmmc) RemovePeer(addr, port string)

func (*Bmmc) Start added in v0.1.2

func (b *Bmmc) Start() error

Start starts the gossip server and the http server

func (*Bmmc) Stop added in v0.1.2

func (b *Bmmc) Stop()

Stop stops the gossip server and the http server

type Config

type Config struct {
	// Addr is HTTP address for node which runs gossip and http servers
	// Required field
	Addr string
	// Port is HTTP port for node which runs gossip  and http servers
	// Required field
	Port string
	// PeerBuf is the list of peers
	// Optional field
	Peers []Peer
	// Beta is the expected fanout for gossip rounds
	// Optional field
	Beta float64
	// Logger
	// Optional field
	Logger *log.Logger
	// Callbacks funtions
	// Optional field
	Callbacks map[string]func(string, *log.Logger) (bool, error)
}

type Peer added in v0.1.6

type Peer struct {
	Addr string
	Port string
}

Jump to

Keyboard shortcuts

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