caasfirewaller

package
v0.0.0-...-666b07d Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: AGPL-3.0 Imports: 14 Imported by: 1

Documentation

Index

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 NewWorker

func NewWorker(config Config) (worker.Worker, error)

NewWorker starts and returns a new CAAS unit firewaller worker.

Types

type ApplicationGetter

type ApplicationGetter interface {
	WatchApplications() (watcher.StringsWatcher, error)
	WatchApplication(string) (watcher.NotifyWatcher, error)
	IsExposed(string) (bool, error)
	ApplicationConfig(string) (config.ConfigAttributes, error)
}

ApplicationGetter provides an interface for watching for the lifecycle state changes (including addition) of applications in the model, and fetching their details.

type CharmGetter

type CharmGetter interface {
	ApplicationCharmInfo(string) (*charms.CharmInfo, error)
}

type Client

type Client interface {
	ApplicationGetter
	LifeGetter
	CharmGetter
}

Client provides an interface for interacting with the CAASFirewaller API. Subsets of this should be passed to the CAASFirewaller worker.

type Config

type Config struct {
	ControllerUUID    string
	ModelUUID         string
	ApplicationGetter ApplicationGetter
	LifeGetter        LifeGetter
	CharmGetter       CharmGetter
	ServiceExposer    ServiceExposer
	Logger            Logger
}

Config holds configuration for the CAAS unit firewaller worker.

func (Config) Validate

func (config Config) Validate() error

Validate validates the worker configuration.

type LifeGetter

type LifeGetter interface {
	Life(string) (life.Value, error)
}

LifeGetter provides an interface for getting the lifecycle state value for an application.

type Logger

type Logger interface {
	Debugf(string, ...interface{})
	Warningf(string, ...interface{})
	Errorf(string, ...interface{})
	Tracef(string, ...interface{})
}

Logger represents the methods used by the worker to log details.

type ManifoldConfig

type ManifoldConfig struct {
	APICallerName string
	BrokerName    string

	ControllerUUID string
	ModelUUID      string

	NewClient func(base.APICaller) Client
	NewWorker func(Config) (worker.Worker, error)
	Logger    Logger
}

ManifoldConfig describes the resources used by the firewaller worker.

func (ManifoldConfig) Validate

func (config ManifoldConfig) Validate() error

Validate is called by start to check for bad configuration.

type ServiceExposer

type ServiceExposer interface {
	ExposeService(appName string, resourceTags map[string]string, config config.ConfigAttributes) error
	UnexposeService(appName string) error
}

Jump to

Keyboard shortcuts

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