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

package migrationminion

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

Index

Package Files

manifold.go shim.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs the migration worker.

func New Uses

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

New returns a Worker backed by config, or an error.

func NewWorker Uses

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

type Config Uses

type Config struct {
    Agent             agent.Agent
    Facade            Facade
    Guard             fortress.Guard
    Clock             clock.Clock
    APIOpen           func(*api.Info, api.DialOpts) (api.Connection, error)
    ValidateMigration func(base.APICaller) error
}

Config defines the operation of a Worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate returns an error if config cannot drive a Worker.

type Facade Uses

type Facade interface {
    Watch() (watcher.MigrationStatusWatcher, error)
    Report(migrationId string, phase migration.Phase, success bool) error
}

Facade exposes controller functionality to a Worker.

func NewFacade Uses

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

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName         string
    APICallerName     string
    FortressName      string
    Clock             clock.Clock
    APIOpen           func(*api.Info, api.DialOpts) (api.Connection, error)
    ValidateMigration func(base.APICaller) error

    NewFacade func(base.APICaller) (Facade, error)
    NewWorker func(Config) (worker.Worker, error)
}

ManifoldConfig defines the names of the manifolds on which a Worker manifold will depend.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

validate is called by start to check for bad configuration.

type Worker Uses

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

Worker waits for a model migration to be active, then locks down the configured fortress and implements the migration.

func (*Worker) Kill Uses

func (w *Worker) Kill()

Kill implements worker.Worker.

func (*Worker) Wait Uses

func (w *Worker) Wait() error

Wait implements worker.Worker.

Package migrationminion imports 16 packages (graph) and is imported by 45 packages. Updated 2019-10-02. Refresh now. Tools for package owners.