Documentation ¶
Index ¶
- func Manifold(cfg ManifoldConfig) dependency.Manifold
- func NewFirewaller(cfg Config) (worker.Worker, error)
- func NewRemoteRelationsFacade(apiCaller base.APICaller) (*remoterelations.Client, error)
- func NewWorker(cfg Config) (worker.Worker, error)
- type Config
- type CrossModelFirewallerFacade
- type CrossModelFirewallerFacadeCloser
- type EnvironFirewaller
- type EnvironInstances
- type Firewaller
- type FirewallerAPI
- type ManifoldConfig
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 ¶
NewFirewaller returns a new Firewaller.
func NewRemoteRelationsFacade ¶
func NewRemoteRelationsFacade(apiCaller base.APICaller) (*remoterelations.Client, error)
NewRemoteRelationsFacade creates a remote relations API facade.
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.
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) 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.