raft

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2023 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Replica

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

Replica participates in elections, if it becomes a leader sends commands to follower servers

func NewReplica

func NewReplica(storage raftstorage.Storage, server *raftgrpc.ReplicaServer, logger *logrus.Logger) *Replica

func (*Replica) ExecuteCommand

func (r *Replica) ExecuteCommand(commandName string) error

func (*Replica) RegisterCommand

func (r *Replica) RegisterCommand(commandName string, command raftgrpc.Command)

func (*Replica) Run

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

type ReplicaInterface

type ReplicaInterface interface {
	RegisterCommand(commandName string, command raftgrpc.Command)
	ExecuteCommand(commandName string) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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