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

package apiaddressupdater

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

Index

Package Files

apiaddressupdater.go manifold.go

func Manifold Uses

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 Uses

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

NewAPIAddressUpdater returns a worker.Worker that watches for changes to API addresses and then sets them on the APIAddressSetter. TODO(fwereade): this should have a config struct, and some validation.

type APIAddressSetter Uses

type APIAddressSetter interface {
    SetAPIHostPorts(servers []corenetwork.HostPorts) error
}

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

type APIAddressUpdater Uses

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 Uses

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

Handle is part of the watcher.NotifyHandler interface.

func (*APIAddressUpdater) Report Uses

func (c *APIAddressUpdater) Report() map[string]interface{}

Report shows up in the dependency engine report.

func (*APIAddressUpdater) SetUp Uses

func (c *APIAddressUpdater) SetUp() (watcher.NotifyWatcher, error)

SetUp is part of the watcher.NotifyHandler interface.

func (*APIAddressUpdater) TearDown Uses

func (c *APIAddressUpdater) TearDown() error

TearDown is part of the watcher.NotifyHandler interface.

type APIAddresser Uses

type APIAddresser interface {
    APIHostPorts() ([]corenetwork.ProviderHostPorts, 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 Uses

type ManifoldConfig engine.AgentAPIManifoldConfig

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

Package apiaddressupdater imports 16 packages (graph) and is imported by 78 packages. Updated 2019-10-05. Refresh now. Tools for package owners.