Back to godoc.org
github.com/juju/juju/worker/applicationscaler

package applicationscaler

v0.0.0 (4dcf1d7)
Latest Go to latest
Published: 1 day ago | License: AGPL-3.0 | Module: github.com/juju/juju

Index

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that runs an applicationscaler worker.

func New

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

New returns a worker that will attempt to rescale any applications that might be undersized.

type Config

type Config struct {
	Facade Facade
}

Config defines a worker's dependencies.

func (Config) Validate

func (config Config) Validate() error

Validate returns an error if the config can't be expected to run a functional worker.

type Facade

type Facade interface {

	// Watch returns a StringsWatcher reporting names of
	// applications which may have insufficient units.
	Watch() (watcher.StringsWatcher, error)

	// Rescale scales up any named application observed to be
	// running too few units.
	Rescale(applications []string) error
}

Facade defines the capabilities required by the worker.

func NewFacade

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

NewFacade creates a Facade from a base.APICaller. It's a sensible value for ManifoldConfig.NewFacade.

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string
	NewFacade     func(base.APICaller) (Facade, error)
	NewWorker     func(Config) (worker.Worker, error)
}

ManifoldConfig holds dependencies and configuration for an applicationscaler worker.

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
f or F : Jump to identifier