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

package controller

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


Package Files

manifold.go tracker.go


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 2020-07-21. Refresh now. Tools for package owners.