firewall

package
v0.0.0-...-b9bb202 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2024 License: AGPL-3.0 Imports: 17 Imported by: 2

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, modelConfigService ModelConfigService, 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, modelConfigService ModelConfigService, 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
	IsManual() (bool, error)
}

type ModelConfigService

type ModelConfigService interface {
	ModelConfig(ctx context.Context) (*config.Config, error)
	Watch() (watcher.StringsWatcher, error)
}

ModelConfigService is an interface that provides access to the model configuration.

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

	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