raft

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChangeLeaderNotification

type ChangeLeaderNotification struct {
	CurrentLeaderAddress string
	IsLeader             bool
	LeaderElected        bool
}

type Raft

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

func NewRaft

func NewRaft(tcpListener net.Listener, configuration config.ClusterConfiguration, state raft.FSM, logger hclog.Logger) (*Raft, error)

func (*Raft) BootstrapCluster

func (r *Raft) BootstrapCluster() error

func (*Raft) GracefulShutdown

func (r *Raft) GracefulShutdown() error

func (*Raft) Leader

func (r *Raft) Leader() raft.ServerAddress

func (*Raft) LeaderNotificationsCh

func (r *Raft) LeaderNotificationsCh() <-chan ChangeLeaderNotification

func (*Raft) LocalID

func (r *Raft) LocalID() string

func (*Raft) Servers

func (r *Raft) Servers() ([]raft.Server, error)

func (*Raft) SyncApply

func (r *Raft) SyncApply(command []byte) (interface{}, error)

type StreamLayer

type StreamLayer struct {
	net.Listener
}

func (*StreamLayer) Dial

func (r *StreamLayer) Dial(address raft.ServerAddress, timeout time.Duration) (net.Conn, error)

Jump to

Keyboard shortcuts

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