This section is empty.


This section is empty.


func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run a Worker as configured.

func NewWorker

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

NewWorker returns a worker that unlocks the model upgrade gate.


type Config

type Config struct {
	// Facade holds the API facade used by this worker for getting,
	// setting and watching the model's environ version.
	Facade Facade

	// GateUnlocker holds a gate.Unlocker that the worker must call
	// after the model has been successfully upgraded.
	GateUnlocker gate.Unlocker

	// ModelTag holds the tag of the model to which this worker is
	// scoped.
	ModelTag names.ModelTag

Config holds the configuration and dependencies for a worker.

func (Config) Validate

func (config Config) Validate() error

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

type Facade

type Facade interface {
	SetModelStatus(names.ModelTag, status.Status, string, map[string]interface{}) error

Facade exposes capabilities required by the worker.

func NewFacade

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

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string
	GateName      string
	ModelTag      names.ModelTag

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

ManifoldConfig describes how to configure and construct a Worker, and what registered resources it may depend upon.