juju: github.com/wallyworld/juju/worker/applicationscaler Index | Files

package applicationscaler

import "github.com/wallyworld/juju/worker/applicationscaler"


Package Files

manifold.go shim.go worker.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

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

func New Uses

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

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

type Config Uses

type Config struct {
    Facade Facade

Config defines a worker's dependencies.

func (Config) Validate Uses

func (config Config) Validate() error

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

type Facade Uses

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 Uses

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 Uses

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.

Package applicationscaler imports 8 packages (graph). Updated 2020-05-08. Refresh now. Tools for package owners.