Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotFound indicates that the worker cannot run because // the configured entity does not exist. ErrNotFound = errors.New("entity not found") // ErrValueChanged indicates that the result of Check is // outdated, and the worker should be restarted. ErrValueChanged = errors.New("flag value changed") )
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency.Manifold that will run a Worker as configured.
Types ¶
type Facade ¶
type Facade interface { Watch(names.Tag) (watcher.NotifyWatcher, error) Life(names.Tag) (life.Value, error) }
Facade exposes capabilities required by the worker.
type ManifoldConfig ¶
type ManifoldConfig struct { APICallerName string Entity names.Tag Result life.Predicate Filter dependency.FilterFunc NewFacade func(base.APICaller) (Facade, error) NewWorker func(Config) (worker.Worker, error) }
ManifoldConfig describes how to configure and construct a Worker, and what registered resources it may depend upon.
type Worker ¶
type Worker struct {
// contains filtered or unexported fields
}
Worker holds the result of some predicate regarding an entity's life, and fails with ErrValueChanged when the result of the predicate changes.
Click to show internal directories.
Click to hide internal directories.