raft

package
v0.0.0-...-f429149 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Protocol

type Protocol struct {
	node.Protocol
	// contains filtered or unexported fields
}

Protocol is an implementation of the Client interface providing the Raft consensus protocol

func NewProtocol

func NewProtocol(config *config.ProtocolConfig) *Protocol

NewProtocol returns a new Raft Protocol instance

func (*Protocol) Client

func (p *Protocol) Client() node.Client

Client returns the Raft protocol client

func (*Protocol) Start

func (p *Protocol) Start(cluster cluster.Cluster, registry *node.Registry) error

Start starts the Raft protocol

func (*Protocol) Stop

func (p *Protocol) Stop() error

Stop stops the Raft protocol

type Server

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

Server implements the Raft consensus protocol server

func NewServer

func NewServer(clusterConfig cluster.Cluster, registry *node.Registry, protocolConfig *config.ProtocolConfig) *Server

NewServer returns a new Raft consensus protocol server

func (*Server) Start

func (s *Server) Start() error

Start starts the Raft server

func (*Server) Stop

func (s *Server) Stop() error

Stop shuts down the Raft server

func (*Server) WaitForReady

func (s *Server) WaitForReady() error

WaitForReady blocks the current goroutine until the server is ready

Directories

Path Synopsis
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
log

Jump to

Keyboard shortcuts

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