Back to godoc.org
github.com/juju/juju / worker / raft / raftbackstop

Package raftbackstop

v0.0.0-...-194c9aa
Latest Go to latest

The latest major version is .

Published: today | License: AGPL-3.0 | Module: github.com/juju/juju

Index

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold for running a raftbackstop worker.

func NewWorker

func NewWorker(config Config) (worker.Worker, error)

NewWorker returns a worker responsible for recovering the raft cluster when it's been reduced to one server that can't become leader.

type Config

type Config struct {
	Raft     RaftNode
	LogStore raft.LogStore
	Hub      *pubsub.StructuredHub
	Logger   Logger
	LocalID  raft.ServerID
}

Config holds the values needed by the worker.

func (Config) Validate

func (config Config) Validate() error

Validate validates the raft worker configuration.

type Logger

type Logger interface {
	Infof(message string, args ...interface{})
	Debugf(message string, args ...interface{})
	Tracef(message string, args ...interface{})
}

Logger represents the logging methods called.

type ManifoldConfig

type ManifoldConfig struct {
	RaftName       string
	CentralHubName string
	AgentName      string

	Logger    loggo.Logger
	NewWorker func(Config) (worker.Worker, error)
}

ManifoldConfig holds the information necessary to run a worker for maintaining the raft backstop configuration in a dependency.Engine.

type RaftNode

type RaftNode interface {
	State() raft.RaftState
	GetConfiguration() raft.ConfigurationFuture
	BootstrapCluster(configuration raft.Configuration) raft.Future
}

RaftNode captures the part of the *raft.Raft API needed by the backstop worker.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier