Documentation
¶
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 runs a worker responsible for shepherding a Dying model into Dead and ultimate removal.
Types ¶
type Config ¶
type Config struct {
Facade Facade
CredentialAPI common.CredentialAPI
Logger logger.Logger
Clock clock.Clock
NewCloudDestroyerFunc func(context.Context, environs.OpenParams, environs.CredentialInvalidator) (environs.CloudDestroyer, error)
}
Config holds the resources and configuration necessary to run an undertaker worker.
type Facade ¶
type Facade interface {
environs.EnvironConfigGetter
ModelInfo(context.Context) (params.UndertakerModelInfoResult, error)
WatchModelResources(context.Context) (watcher.NotifyWatcher, error)
WatchModel(context.Context) (watcher.NotifyWatcher, error)
ProcessDyingModel(context.Context) error
RemoveModel(context.Context) error
}
Facade covers the parts of the api/undertaker.UndertakerClient that we need for the worker. It's more than a little raw, but we'll survive.
type ManifoldConfig ¶
type ManifoldConfig struct {
APICallerName string
Logger logger.Logger
Clock clock.Clock
NewFacade func(base.APICaller) (Facade, error)
NewWorker func(Config) (worker.Worker, error)
NewCredentialValidatorFacade func(base.APICaller) (common.CredentialAPI, error)
NewCloudDestroyerFunc func(context.Context, environs.OpenParams, environs.CredentialInvalidator) (environs.CloudDestroyer, error)
}
ManifoldConfig holds the names of the resources used by, and the additional dependencies of, an undertaker worker.
type Undertaker ¶
type Undertaker struct {
// contains filtered or unexported fields
}
func NewUndertaker ¶
func NewUndertaker(config Config) (*Undertaker, error)
NewUndertaker returns a worker which processes a dying model.
func (*Undertaker) Wait ¶
func (u *Undertaker) Wait() error
Wait is part of the worker.Worker interface.
Click to show internal directories.
Click to hide internal directories.