Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold builds a dependency.Manifold for running a raftforwarder worker.
func NewTarget ¶
func NewTarget(st *state.State, logger raftleasestore.Logger) raftlease.NotifyTarget
NewTarget is a shim to construct a raftlease.NotifyTarget for testability.
Types ¶
type Config ¶
type Config struct {
Hub *pubsub.StructuredHub
Raft RaftApplier
Logger Logger
Topic string
Target raftlease.NotifyTarget
PrometheusRegisterer prometheus.Registerer
}
Config defines the resources the worker needs to run.
type Logger ¶
type Logger interface {
Errorf(string, ...interface{})
Warningf(string, ...interface{})
Infof(string, ...interface{})
Tracef(string, ...interface{})
}
Logger specifies the interface we use from loggo.Logger.
type ManifoldConfig ¶
type ManifoldConfig struct {
RaftName string
StateName string
CentralHubName string
RequestTopic string
PrometheusRegisterer prometheus.Registerer
Logger Logger
NewWorker func(Config) (worker.Worker, error)
NewTarget func(*state.State, raftleasestore.Logger) raftlease.NotifyTarget
}
ManifoldConfig holds the resources needed to start a raft forwarder worker in a dependency engine.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate checks that the config has all the required values.
type RaftApplier ¶
type RaftApplier interface {
Apply(cmd []byte, timeout time.Duration) raft.ApplyFuture
}
RaftApplier allows applying a command to the raft FSM.
Click to show internal directories.
Click to hide internal directories.