Documentation ¶
Index ¶
- Variables
- func IgnoreErrRemoved(err error) error
- func IsFatal(err error) bool
- func LifeFilter(err error) error
- func Manifolds(config ManifoldsConfig) dependency.Manifolds
- func WorstError(err, _ error) error
- func WrapAgent(a agent.Agent, controllerUUID, modelUUID string) (agent.Agent, error)
- type ManifoldsConfig
Constants ¶
This section is empty.
Variables ¶
var ErrRemoved = errors.New("model removed")
ErrRemoved may be returned by some worker started from Manifolds to indicate that the model under management no longer exists.
Functions ¶
func IgnoreErrRemoved ¶
IgnoreErrRemoved returns nil if passed an error caused by ErrRemoved, and otherwise returns the original error.
func IsFatal ¶
IsFatal will probably be helpful when configuring a dependency.Engine to run the result of Manifolds.
func LifeFilter ¶
LifeFilter is used with the lifeflag manifolds -- which do not depend on runFlag -- to return appropriate errors for consumption by the enclosing dependency.Engine (and/or its IsFatal check).
func Manifolds ¶
func Manifolds(config ManifoldsConfig) dependency.Manifolds
Manifolds returns a set of interdependent dependency manifolds that will run together to administer a model, as configured.
func WorstError ¶
WorstError will probably be helpful when configuring a dependency.Engine to run the result of Manifolds.
Types ¶
type ManifoldsConfig ¶
type ManifoldsConfig struct { // Agent identifies, and exposes configuration for, the controller // machine running these manifolds and the model the manifolds // should administer. // // You should almost certainly set this value to one created by // model.WrapAgent. Agent coreagent.Agent // AgentConfigChanged will be set whenever the agent's api config // is updated AgentConfigChanged *voyeur.Value // Clock supplies timing services to any manifolds that need them. // Only a few workers have been converted to use them fo far. Clock clock.Clock // InstPollerAggregationDelay is the delay before sending a batch of // requests in the instancpoller.Worker's aggregate loop. InstPollerAggregationDelay time.Duration // RunFlagDuration defines for how long this controller will ask // for model administration rights; most of the workers controlled // by this agent will only be started when the run flag is known // to be held. RunFlagDuration time.Duration // CharmRevisionUpdateInterval determines how often the charm- // revision worker will check for new revisions of known charms. CharmRevisionUpdateInterval time.Duration // StatusHistoryPruner* values control status-history pruning // behaviour. StatusHistoryPrunerMaxHistoryTime time.Duration StatusHistoryPrunerMaxHistoryMB uint StatusHistoryPrunerInterval time.Duration // SpacesImportedGate will be unlocked when spaces are known to // have been imported. SpacesImportedGate gate.Lock // NewEnvironFunc is a function opens a provider "environment" // (typically environs.New). NewEnvironFunc environs.NewEnvironFunc // NewMigrationMaster is called to create a new migrationmaster // worker. NewMigrationMaster func(migrationmaster.Config) (worker.Worker, error) }
ManifoldsConfig holds the dependencies and configuration options for a model agent: that is, for the set of interdependent workers that observe and manipulate a single model.