replica

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options added in v0.2.0

type Options struct {
	Logger           logrus.FieldLogger
	TimerOpts        timer.Options
	MessageQueueOpts mq.Options
}

func DefaultOptions added in v0.4.0

func DefaultOptions() Options

func (Options) WithLogLevel added in v0.4.0

func (opts Options) WithLogLevel(level logrus.Level) Options

func (Options) WithLogOutput added in v0.4.0

func (opts Options) WithLogOutput(output io.Writer) Options

func (Options) WithTimerOptions added in v0.4.0

func (opts Options) WithTimerOptions(timerOpts timer.Options) Options

type Replica

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

A Replica represents one Process in a replicated state machine that is bound to a specific Shard. It signs Messages before sending them to other Replicas, and verifies Messages before accepting them from other Replicas.

func New

func New(opts Options, whoami id.Signatory, signatories []id.Signatory, propose process.Proposer, validate process.Validator, commit process.Committer, catch process.Catcher, broadcast process.Broadcaster) *Replica

func (*Replica) Precommit added in v0.4.0

func (replica *Replica) Precommit(ctx context.Context, precommit process.Precommit)

func (*Replica) Prevote added in v0.4.0

func (replica *Replica) Prevote(ctx context.Context, prevote process.Prevote)

func (*Replica) Propose added in v0.4.0

func (replica *Replica) Propose(ctx context.Context, propose process.Propose)

func (*Replica) Run added in v0.4.0

func (replica *Replica) Run(ctx context.Context)

Jump to

Keyboard shortcuts

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