firewaller

package
v0.0.0-...-8ff1004 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2019 License: AGPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Manifold

func Manifold(cfg ManifoldConfig) dependency.Manifold

Manifold returns a Manifold that encapsulates the firewaller worker.

func NewFirewaller

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

NewFirewaller returns a new Firewaller.

func NewRemoteRelationsFacade

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

NewRemoteRelationsFacade creates a remote relations API facade.

func NewWorker

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

NewWorker creates a firewaller worker.

Types

type Config

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

	NewCrossModelFacadeFunc newCrossModelFacadeFunc

	Clock clock.Clock

	CredentialAPI common.CredentialAPI
}

Config defines the operation of a Worker.

func (Config) Validate

func (cfg Config) Validate() error

Validate returns an error if cfg cannot drive a Worker.

type CrossModelFirewallerFacade

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

type CrossModelFirewallerFacadeCloser interface {
	io.Closer
	CrossModelFirewallerFacade
}

RemoteFirewallerAPICloser implements CrossModelFirewallerFacade and adds a Close() method.

type EnvironFirewaller

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

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

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

func (fw *Firewaller) Kill()

Kill is part of the worker.Worker interface.

func (*Firewaller) Wait

func (fw *Firewaller) Wait() error

Wait is part of the worker.Worker interface.

type FirewallerAPI

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

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

NewFirewallerFacade creates a firewaller API facade.

type ManifoldConfig

type ManifoldConfig struct {
	AgentName     string
	APICallerName string
	EnvironName   string

	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

func (cfg ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL