Documentation ¶
Index ¶
- func StateShim(st *state.State, m *state.Model) stateShim
- func WatchEgressAddressesForRelations(resources facade.Resources, st State, modelConfigService ModelConfigService, ...) (params.StringsWatchResults, error)
- type Application
- type EgressAddressWatcher
- type Machine
- type ModelConfigService
- type Relation
- type State
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func 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 }