raft

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2020 License: MIT Imports: 15 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 LoggerAdapter

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

func (*LoggerAdapter) Debug

func (l *LoggerAdapter) Debug(msg string, args ...interface{})

func (*LoggerAdapter) Error

func (l *LoggerAdapter) Error(msg string, args ...interface{})

func (*LoggerAdapter) ImpliedArgs

func (l *LoggerAdapter) ImpliedArgs() []interface{}

func (*LoggerAdapter) Info

func (l *LoggerAdapter) Info(msg string, args ...interface{})

func (*LoggerAdapter) IsDebug

func (l *LoggerAdapter) IsDebug() bool

func (*LoggerAdapter) IsError

func (l *LoggerAdapter) IsError() bool

func (*LoggerAdapter) IsInfo

func (l *LoggerAdapter) IsInfo() bool

func (*LoggerAdapter) IsTrace

func (l *LoggerAdapter) IsTrace() bool

func (*LoggerAdapter) IsWarn

func (l *LoggerAdapter) IsWarn() bool

func (*LoggerAdapter) Log

func (l *LoggerAdapter) Log(level logrus.Level, msg string, args ...interface{})

func (*LoggerAdapter) Name

func (l *LoggerAdapter) Name() string

func (*LoggerAdapter) Named

func (l *LoggerAdapter) Named(name string) hclog.Logger

func (*LoggerAdapter) ResetNamed

func (l *LoggerAdapter) ResetNamed(name string) hclog.Logger

func (*LoggerAdapter) SetLevel

func (l *LoggerAdapter) SetLevel(level hclog.Level)

Skip

func (*LoggerAdapter) StandardLogger

func (l *LoggerAdapter) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger

func (*LoggerAdapter) StandardWriter

func (l *LoggerAdapter) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer

func (*LoggerAdapter) Trace

func (l *LoggerAdapter) Trace(msg string, args ...interface{})

func (*LoggerAdapter) Warn

func (l *LoggerAdapter) Warn(msg string, args ...interface{})

func (*LoggerAdapter) With

func (l *LoggerAdapter) With(args ...interface{}) hclog.Logger

No need to implement that as Raft doesn't use this method.

type Raft

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

func NewRaft

func NewRaft(tcpListener net.Listener, configuration config.ClusterConfiguration, state raft.FSM) (*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