charmrevision

package
v0.0.0-...-4bd6544 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2016 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWorker

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

NewWorker returns a worker that calls UpdateLatestRevisions on the configured RevisionUpdater, once when started and subsequently every Period.

Types

type Config

type Config struct {

	// RevisionUpdater is the worker's view of the controller.
	RevisionUpdater RevisionUpdater

	// Clock is the worker's view of time.
	Clock clock.Clock

	// Period is the time between charm revision updates.
	Period time.Duration
}

Config defines the operation of a charm revision updater worker.

func (Config) Validate

func (config Config) Validate() error

Validate returns an error if the configuration cannot be expected to start a functional worker.

type RevisionUpdater

type RevisionUpdater interface {

	// UpdateLatestRevisions causes the environment to be scanned, the charm
	// store to be interrogated, and model representations of updated charms
	// to be stored in the environment.
	//
	// That is sufficiently complex that the logic should be implemented by
	// the worker, not directly on the apiserver; as this functionality needs
	// to change/mature, please migrate responsibilities down to the worker
	// and grow this interface to match.
	UpdateLatestRevisions() error
}

RevisionUpdater exposes the "single" capability required by the worker. As the worker gains more responsibilities, it will likely need more; see storageprovisioner for a helpful model to grow towards.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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