consensus

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConsEngine

type ConsEngine struct {
	M *MsgMapper
	// contains filtered or unexported fields
}

ConsEngine Consensus engine

func NewConsEngine

func NewConsEngine() *ConsEngine

NewConsEngine New a consensus engine

func (*ConsEngine) Add2Engine

func (c *ConsEngine) Add2Engine(msg *nats.Msg) error

Add2Engine Add a message to consensus engine

func (*ConsEngine) SetSequence

func (c *ConsEngine) SetSequence(s int64)

func (*ConsEngine) StartEngine

func (c *ConsEngine) StartEngine(from, to string) error

type Ferry

type Ferry struct {
}

Ferry Comsumer tx message and handle(consensus, broadcast...) it.

type MsgMapper

type MsgMapper struct {
	MsgMap map[int64]map[string]string
	// contains filtered or unexported fields
}

func (*MsgMapper) AddMsgToMap

func (m *MsgMapper) AddMsgToMap(event types.Event, f *Ferry) (sequence int64, err error)

Jump to

Keyboard shortcuts

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