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

package firewaller

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

Index

Package Files

firewaller.go manifold.go shim.go

func Manifold Uses

func Manifold(cfg ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the firewaller worker.

func NewFirewaller Uses

func NewFirewaller(cfg Config) (worker.Worker, error)

NewFirewaller returns a new Firewaller.

func NewRemoteRelationsFacade Uses

func NewRemoteRelationsFacade(apiCaller base.APICaller) (*remoterelations.Client, error)

NewRemoteRelationsFacade creates a remote relations API facade.

func NewWorker Uses

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

NewWorker creates a firewaller worker.

type Config Uses

type Config struct {
    ModelUUID          string
    Mode               string
    FirewallerAPI      FirewallerAPI
    RemoteRelationsApi *remoterelations.Client
    EnvironFirewaller  EnvironFirewaller
    EnvironInstances   EnvironInstances

    NewCrossModelFacadeFunc newCrossModelFacadeFunc

    Clock  clock.Clock
    Logger Logger

    CredentialAPI common.CredentialAPI
}

Config defines the operation of a Worker.

func (Config) Validate Uses

func (cfg Config) Validate() error

Validate returns an error if cfg cannot drive a Worker.

type CrossModelFirewallerFacade Uses

type CrossModelFirewallerFacade interface {
    PublishIngressNetworkChange(params.IngressNetworksChangeEvent) error
    WatchEgressAddressesForRelation(details params.RemoteEntityArg) (watcher.StringsWatcher, error)
}

CrossModelFirewallerFacade exposes firewaller functionality on the remote offering model to a worker.

type CrossModelFirewallerFacadeCloser Uses

type CrossModelFirewallerFacadeCloser interface {
    io.Closer
    CrossModelFirewallerFacade
}

RemoteFirewallerAPICloser implements CrossModelFirewallerFacade and adds a Close() method.

type EnvironFirewaller Uses

type EnvironFirewaller interface {
    environs.Firewaller
}

EnvironFirewaller defines methods to allow the worker to perform firewall operations (open/close ports) on a Juju cloud environment.

type EnvironInstances Uses

type EnvironInstances interface {
    Instances(ctx context.ProviderCallContext, ids []instance.Id) ([]instances.Instance, error)
}

EnvironInstances defines methods to allow the worker to perform operations on instances in a Juju cloud environment.

type Firewaller Uses

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

Firewaller watches the state for port ranges opened or closed on machines and reflects those changes onto the backing environment. Uses Firewaller API V1.

func (*Firewaller) Kill Uses

func (fw *Firewaller) Kill()

Kill is part of the worker.Worker interface.

func (*Firewaller) Wait Uses

func (fw *Firewaller) Wait() error

Wait is part of the worker.Worker interface.

type FirewallerAPI Uses

type FirewallerAPI interface {
    WatchModelMachines() (watcher.StringsWatcher, error)
    WatchOpenedPorts() (watcher.StringsWatcher, error)
    Machine(tag names.MachineTag) (*firewaller.Machine, error)
    Unit(tag names.UnitTag) (*firewaller.Unit, error)
    Relation(tag names.RelationTag) (*firewaller.Relation, error)
    WatchEgressAddressesForRelation(tag names.RelationTag) (watcher.StringsWatcher, error)
    WatchIngressAddressesForRelation(tag names.RelationTag) (watcher.StringsWatcher, error)
    ControllerAPIInfoForModel(modelUUID string) (*api.Info, error)
    MacaroonForRelation(relationKey string) (*macaroon.Macaroon, error)
    SetRelationStatus(relationKey string, status relation.Status, message string) error
    FirewallRules(applicationNames ...string) ([]params.FirewallRule, error)
}

FirewallerAPI exposes functionality off the firewaller API facade to a worker.

func NewFirewallerFacade Uses

func NewFirewallerFacade(apiCaller base.APICaller) (FirewallerAPI, error)

NewFirewallerFacade creates a firewaller API facade.

type Logger Uses

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

Logger represents the methods used by the worker to log details.

type ManifoldConfig Uses

type ManifoldConfig struct {
    AgentName     string
    APICallerName string
    EnvironName   string
    Logger        Logger

    NewControllerConnection      apicaller.NewExternalControllerConnectionFunc
    NewRemoteRelationsFacade     func(base.APICaller) (*remoterelations.Client, error)
    NewFirewallerFacade          func(base.APICaller) (FirewallerAPI, error)
    NewFirewallerWorker          func(Config) (worker.Worker, error)
    NewCredentialValidatorFacade func(base.APICaller) (common.CredentialAPI, error)
}

ManifoldConfig describes the resources used by the firewaller worker.

func (ManifoldConfig) Validate Uses

func (cfg ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

Package firewaller imports 31 packages (graph) and is imported by 49 packages. Updated 2019-10-23. Refresh now. Tools for package owners.