Documentation ¶
Overview ¶
Copyright 2017 Canonical Ltd. Licensed under the AGPLv3, see LICENCE file for details.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency.Manifold that will run a model worker manager.
Types ¶
type Config ¶
type Config struct { ModelWatcher ModelWatcher ModelGetter ModelGetter NewModelWorker NewModelWorkerFunc ErrorDelay time.Duration }
Config holds the dependencies and configuration necessary to run a model worker manager.
type ManifoldConfig ¶
type ManifoldConfig struct { StateName string NewWorker func(Config) (worker.Worker, error) NewModelWorker NewModelWorkerFunc }
ManifoldConfig holds the information necessary to run a model worker manager in a dependency.Engine.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate validates the manifold configuration.
type Model ¶
type Model interface { MigrationMode() state.MigrationMode Type() state.ModelType }
Model represents a model.
type ModelGetter ¶
ModelGetter provides an interface for getting models by UUID. Once a model is no longer required, the returned function must be called to dispose of the model.
type ModelWatcher ¶
type ModelWatcher interface {
WatchModels() state.StringsWatcher
}
ModelWatcher provides an interface for watching the additiona and removal of models.
type NewModelWorkerFunc ¶
NewModelWorkerFunc should return a worker responsible for running all a model's required workers; and for returning nil when there's no more model to manage.
type StatePoolModelGetter ¶
StatePoolModelGetter implements ModelGetter in terms of a *state.StatePool.