Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(config ManifoldConfig) dependency.Manifold

Manifold returns a dependency manifold that runs an API address updater worker, using the resource names defined in the supplied config.

func NewAPIAddressUpdater

func NewAPIAddressUpdater(addresser APIAddresser, setter APIAddressSetter) worker.Worker

NewAPIAddressUpdater returns a worker.Worker that watches for changes to API addresses and then sets them on the APIAddressSetter.

Types

type APIAddressSetter

type APIAddressSetter interface {
	SetAPIHostPorts(servers [][]network.HostPort) error
}

APIAddressSetter is an interface that is provided to NewAPIAddressUpdater whose SetAPIHostPorts method will be invoked whenever address changes occur.

type APIAddressUpdater

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

APIAddressUpdater is responsible for propagating API addresses.

In practice, APIAddressUpdater is used by a machine agent to watch API addresses in state and write the changes to the agent's config file.

func (*APIAddressUpdater) Handle

func (c *APIAddressUpdater) Handle(_ <-chan struct{}) error

func (*APIAddressUpdater) SetUp

func (*APIAddressUpdater) TearDown

func (c *APIAddressUpdater) TearDown() error

type APIAddresser

type APIAddresser interface {
	APIHostPorts() ([][]network.HostPort, error)
	WatchAPIHostPorts() (watcher.NotifyWatcher, error)
}

APIAddresser is an interface that is provided to NewAPIAddressUpdater which can be used to watch for API address changes.

type ManifoldConfig

type ManifoldConfig util.AgentApiManifoldConfig

ManifoldConfig defines the names of the manifolds on which a Manifold will depend.