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

package controllerport

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

Index

Package Files

manifold.go worker.go

func GetControllerConfig Uses

func GetControllerConfig(st *state.State) (controller.Config, error)

GetControllerConfig gets the controller config from the given state - it's a shim so we can test the manifold without a state suite.

func Manifold Uses

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency.Manifold that will run an HTTP server worker. The manifold outputs an *apiserverhttp.Mux, for other workers to register handlers against.

func NewWorker Uses

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

NewWorker returns a new API server worker, with the given configuration.

type Config Uses

type Config struct {
    AgentConfig             agent.Config
    Hub                     *pubsub.StructuredHub
    Logger                  Logger
    ControllerAPIPort       int
    UpdateControllerAPIPort func(int) error
}

Config is the configuration required for running an API server worker.

func (Config) Validate Uses

func (config Config) Validate() error

Validate validates the API server configuration.

type Logger Uses

type Logger interface {
    Debugf(string, ...interface{})
    Infof(string, ...interface{})
    Errorf(string, ...interface{})
}

Logger defines the methods needed for the worker to log messages.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName string
    HubName   string
    StateName string

    Logger                  Logger
    UpdateControllerAPIPort func(int) error

    GetControllerConfig func(*state.State) (controller.Config, error)
    NewWorker           func(Config) (worker.Worker, error)
}

ManifoldConfig holds the information necessary to determine the controller api port and keep it up to date.

func (ManifoldConfig) Validate Uses

func (config ManifoldConfig) Validate() error

Validate validates the manifold configuration.

type Worker Uses

type Worker struct {
    // contains filtered or unexported fields
}

Worker is responsible for updating the agent config when the controller api port value changes, and then bouncing the worker to notify the other dependent workers, which should be the peer-grouper and http-server.

func (*Worker) Kill Uses

func (w *Worker) Kill()

Kill implements Worker.Kill.

func (*Worker) Wait Uses

func (w *Worker) Wait() error

Wait implements Worker.Wait.

Package controllerport imports 10 packages (graph) and is imported by 3 packages. Updated 2018-11-23. Refresh now. Tools for package owners.