juju: github.com/juju/juju/worker/controller Index | Files

package controller

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

Index

Package Files

manifold.go tracker.go

Variables

var ErrControllerClosed = errors.New("controller closed")

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a manifold whose worker which wraps a *state.State, which is in turn wrapped by a Tracker. It will exit if the State's associated mongodb session dies.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName              string
    StateConfigWatcherName string
    OpenController         func(coreagent.Config) (*state.Controller, error)
    MongoPingInterval      time.Duration
}

ManifoldConfig provides the dependencies for Manifold.

type Tracker Uses

type Tracker interface {
    // Use returns wrapped Controller, recording the use of
    // it. ErrControllerClosed is returned if the Controller is closed.
    Use() (*state.Controller, error)

    // Done records that there's one less user of the wrapped Controller,
    // closing it if there's no more users. ErrControllerClosed is returned
    // if the Controller has already been closed (indicating that Done has
    // called too many times).
    Done() error
}

Tracker describes a type which wraps and manages the lifetime of a *state.Controller.

Package controller imports 9 packages (graph). Updated 2018-09-14. Refresh now. Tools for package owners.