firewall

package
v0.0.0-...-9ec3720 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2021 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StateShim

func StateShim(st *state.State, m *state.Model) stateShim

TODO(wallyworld) - for tests, remove when remaining firewaller tests become unit tests.

func WatchEgressAddressesForRelations

func WatchEgressAddressesForRelations(resources facade.Resources, st State, relations params.Entities) (params.StringsWatchResults, error)

WatchEgressAddressesForRelations creates a watcher that notifies when addresses, from which connections will originate for the relation, change. Each event contains the entire set of addresses which are required for ingress for the relation.

Types

type Application

type Application interface {
	Name() string
}

type EgressAddressWatcher

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

EgressAddressWatcher reports changes to addresses for local units in a given relation. Each event contains the entire set of addresses which are required for ingress on the remote side of the relation.

func NewEgressAddressWatcher

func NewEgressAddressWatcher(backend State, rel Relation, appName string) (*EgressAddressWatcher, error)

NewEgressAddressWatcher creates an EgressAddressWatcher.

func (*EgressAddressWatcher) Changes

func (w *EgressAddressWatcher) Changes() <-chan []string

Changes returns the event channel for this watcher.

func (*EgressAddressWatcher) Err

func (w *EgressAddressWatcher) Err() error

Err returns any error encountered while the watcher has been running.

func (*EgressAddressWatcher) Kill

func (w *EgressAddressWatcher) Kill()

Kill asks the watcher to stop without waiting for it do so.

func (*EgressAddressWatcher) Stop

func (w *EgressAddressWatcher) Stop() error

Stop kills the watcher, then waits for it to die.

func (*EgressAddressWatcher) Wait

func (w *EgressAddressWatcher) Wait() error

Wait waits for the watcher to die and returns any error encountered when it was running.

type Machine

type Machine interface {
	Id() string
	WatchAddresses() state.NotifyWatcher
	OpenedPortRanges() (state.MachinePortRanges, error)
	IsManual() (bool, error)
}

type Relation

type Relation interface {
	status.StatusSetter
	Endpoints() []state.Endpoint
	WatchUnits(applicationName string) (state.RelationUnitsWatcher, error)
	WatchRelationIngressNetworks() state.StringsWatcher
	WatchRelationEgressNetworks() state.StringsWatcher
}

type State

type State interface {
	state.ModelMachinesWatcher
	state.ModelAccessor

	WatchSubnets(func(id interface{}) bool) state.StringsWatcher

	KeyRelation(string) (Relation, error)

	Unit(string) (Unit, error)

	Machine(string) (Machine, error)

	Application(string) (Application, error)
}

State provides the subset of global state required by the remote firewaller facade.

type Unit

type Unit interface {
	Name() string
	PublicAddress() (network.SpaceAddress, error)
	AssignedMachineId() (string, error)
}

Jump to

Keyboard shortcuts

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