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

package environ

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


Package Files

environ.go manifold.go

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates a *Tracker and exposes it as an environs.Environ resource.

type Config Uses

type Config struct {
    Observer       ConfigObserver
    NewEnvironFunc environs.NewEnvironFunc
    Logger         Logger

Config describes the dependencies of a Tracker.

It's arguable that it should be called TrackerConfig, because of the heavy use of model config in this package.

func (Config) Validate Uses

func (config Config) Validate() error

Validate returns an error if the config cannot be used to start a Tracker.

type ConfigObserver Uses

type ConfigObserver interface {
    WatchForModelConfigChanges() (watcher.NotifyWatcher, error)
    WatchCloudSpecChanges() (watcher.NotifyWatcher, error)

ConfigObserver exposes a model configuration and a watch constructor that allows clients to be informed of changes to the configuration.

type Logger Uses

type Logger interface {
    Debugf(string, ...interface{})
    Warningf(string, ...interface{})

Logger defines the methods used by the pruner worker for logging.

type ManifoldConfig Uses

type ManifoldConfig struct {
    APICallerName  string
    NewEnvironFunc environs.NewEnvironFunc
    Logger         Logger

ManifoldConfig describes the resources used by a Tracker.

type Tracker Uses

type Tracker struct {
    // contains filtered or unexported fields

Tracker loads an environment, makes it available to clients, and updates the environment in response to config changes until it is killed.

func NewTracker Uses

func NewTracker(config Config) (*Tracker, error)

NewTracker loads an environment from the observer and returns a new Tracker, or an error if anything goes wrong. If a tracker is returned, its Environ() method is immediately usable.

The caller is responsible for Kill()ing the returned Tracker and Wait()ing for any errors it might return.

func (*Tracker) Environ Uses

func (t *Tracker) Environ() environs.Environ

Environ returns the encapsulated Environ. It will continue to be updated in the background for as long as the Tracker continues to run.

func (*Tracker) Kill Uses

func (t *Tracker) Kill()

Kill is part of the worker.Worker interface.

func (*Tracker) Wait Uses

func (t *Tracker) Wait() error

Wait is part of the worker.Worker interface.

Package environ imports 11 packages (graph). Updated 2020-08-11. Refresh now. Tools for package owners.