caasenvironupgrader

package
v0.0.0-...-2f78cd6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

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 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.

Types

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL