applicationscaler

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: 8 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 runs an applicationscaler worker.

func New

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

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

Types

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
	// services which may have insufficient units.
	Watch() (watcher.StringsWatcher, error)

	// Rescale scales up any named service observed to be
	// running too few units.
	Rescale(services []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.

Jump to

Keyboard shortcuts

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