juju: github.com/juju/juju/worker/raft/raftbackstop Index | Files

package raftbackstop

import "github.com/juju/juju/worker/raft/raftbackstop"

Index

Package Files

manifold.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

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

func NewWorker Uses

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 Uses

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 Uses

func (config Config) Validate() error

Validate validates the raft worker configuration.

type Logger Uses

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 Uses

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 Uses

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 raftbackstop imports 11 packages (graph) and is imported by 3 packages. Updated 2019-09-19. Refresh now. Tools for package owners.