juju: github.com/juju/juju/worker/charmrevision Index | Files | Directories

package charmrevision

import "github.com/juju/juju/worker/charmrevision"

Index

Package Files

worker.go

func NewWorker Uses

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.

type Config Uses

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 Uses

func (config Config) Validate() error

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

type RevisionUpdater Uses

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

PathSynopsis
charmrevisionmanifold

Package charmrevision imports 5 packages (graph) and is imported by 48 packages. Updated 2019-10-15. Refresh now. Tools for package owners.