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 EnvironFirewaller
- type EnvironInstances
- type Firewaller
- type FirewallerAPI
- type ManifoldConfig
- type RemoteFirewallerAPI
- type RemoteFirewallerAPICloser
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 NewRemoteFirewallerAPIFunc func(modelUUID string) (RemoteFirewallerAPICloser, error) Clock clock.Clock }
Config defines the operation of a Worker.
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 ¶
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) }
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 NewAPIConnForModel api.NewConnectionForModelFunc NewRemoteRelationsFacade func(base.APICaller) (*remoterelations.Client, error) NewFirewallerFacade func(base.APICaller) (FirewallerAPI, error) NewFirewallerWorker func(Config) (worker.Worker, 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.
type RemoteFirewallerAPI ¶
type RemoteFirewallerAPI interface { IngressSubnetsForRelation(id params.RemoteEntityId) (*params.IngressSubnetInfo, error) WatchSubnets() (watcher.StringsWatcher, error) }
RemoteFirewallerAPI exposes remote firewaller functionality to a worker.
type RemoteFirewallerAPICloser ¶
type RemoteFirewallerAPICloser interface { io.Closer RemoteFirewallerAPI }
RemoteFirewallerAPICloser implements RemoteFirewallerAPI and adds a Close() method.