modelworkermanager

package
v0.0.0-...-a0d7459 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2017 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

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

Types

type Backend

type Backend interface {
	WatchModels() state.StringsWatcher
	GetModel(names.ModelTag) (BackendModel, error)
}

Backend defines the State functionality used by the manager worker.

type BackendModel

type BackendModel interface {
	MigrationMode() state.MigrationMode
}

type BackendShim

type BackendShim struct {
	*state.State
}

func (BackendShim) GetModel

func (s BackendShim) GetModel(tag names.ModelTag) (BackendModel, error)

type Config

type Config struct {
	ControllerUUID string
	Backend        Backend
	NewWorker      NewWorkerFunc
	ErrorDelay     time.Duration
}

Config holds the dependencies and configuration necessary to run a model worker manager.

func (Config) Validate

func (config Config) Validate() error

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

type NewWorkerFunc

type NewWorkerFunc func(controllerUUID, modelUUID string) (worker.Worker, error)

NewWorkerFunc should return a worker responsible for running all a model's required workers; and for returning nil when there's no more model to manage.

Jump to

Keyboard shortcuts

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