juju: github.com/juju/juju/worker/undertaker Index | Files

package undertaker

import "github.com/juju/juju/worker/undertaker"

Index

Package Files

manifold.go shim.go undertaker.go

func Manifold Uses

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.

func NewWorker Uses

func NewWorker(config Config) (worker.Worker, error)

NewFacade creates a worker.Worker from a Config, by calling the local constructor that returns a more specific type.

type Config Uses

type Config struct {
    Facade        Facade
    Destroyer     environs.CloudDestroyer
    CredentialAPI common.CredentialAPI
    Logger        Logger
}

Config holds the resources and configuration necessary to run an undertaker worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate returns an error if the config cannot be expected to drive a functional undertaker worker.

type Facade Uses

type Facade interface {
    ModelInfo() (params.UndertakerModelInfoResult, error)
    WatchModelResources() (watcher.NotifyWatcher, error)
    ProcessDyingModel() error
    RemoveModel() error
    SetStatus(status status.Status, message string, data map[string]interface{}) 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.

func NewFacade Uses

func NewFacade(apiCaller base.APICaller) (Facade, error)

NewFacade creates a Facade from a base.APICaller, by calling the constructor in api/undertaker that returns a more specific type.

type Logger Uses

type Logger interface {
    Errorf(string, ...interface{})
}

Logger defines a way to report non-fatal errors.

type ManifoldConfig Uses

type ManifoldConfig struct {
    APICallerName      string
    CloudDestroyerName string

    Logger                       Logger
    NewFacade                    func(base.APICaller) (Facade, error)
    NewWorker                    func(Config) (worker.Worker, error)
    NewCredentialValidatorFacade func(base.APICaller) (common.CredentialAPI, error)
}

ManifoldConfig holds the names of the resources used by, and the additional dependencies of, an undertaker worker.

type Undertaker Uses

type Undertaker struct {
    // contains filtered or unexported fields
}

func NewUndertaker Uses

func NewUndertaker(config Config) (*Undertaker, error)

NewUndertaker returns a worker which processes a dying model.

func (*Undertaker) Kill Uses

func (u *Undertaker) Kill()

Kill is part of the worker.Worker interface.

func (*Undertaker) Wait Uses

func (u *Undertaker) Wait() error

Wait is part of the worker.Worker interface.

Package undertaker imports 15 packages (graph) and is imported by 23 packages. Updated 2019-06-19. Refresh now. Tools for package owners.