Documentation
¶
Index ¶
- func Manifold(config ManifoldConfig) dependency.Manifold
- func NewAppWorker(config AppWorkerConfig) func() (worker.Worker, error)
- func NewProvisionerWorker(config Config) (worker.Worker, error)
- type AppWorkerConfig
- type CAASBroker
- type CAASProvisionerFacade
- type Config
- type Logger
- type ManifoldConfig
- type NewAppWorkerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold creates a manifold that runs a CAAS operator provisioner. See the ManifoldConfig type for discussion about how this can/should evolve.
func NewAppWorker ¶
func NewAppWorker(config AppWorkerConfig) func() (worker.Worker, error)
Types ¶
type AppWorkerConfig ¶
type AppWorkerConfig struct {
Name string
Facade CAASProvisionerFacade
Broker CAASBroker
ModelTag names.ModelTag
Clock clock.Clock
Logger Logger
}
type CAASBroker ¶
type CAASBroker interface {
Application(string, caas.DeploymentType) caas.Application
AnnotateUnit(appName string, mode caas.DeploymentMode, podName string, unit names.UnitTag) error
}
CAASBroker exposes CAAS broker functionality to a worker.
type CAASProvisionerFacade ¶
type CAASProvisionerFacade interface {
ProvisioningInfo(string) (api.ProvisioningInfo, error)
WatchApplications() (watcher.StringsWatcher, error)
SetPassword(string, string) error
Life(string) (life.Value, error)
CharmInfo(string) (*charmscommon.CharmInfo, error)
ApplicationCharmURL(string) (*charm.URL, error)
SetOperatorStatus(appName string, status status.Status, message string, data map[string]interface{}) error
Units(appName string) ([]names.Tag, error)
GarbageCollect(appName string, observedUnits []names.Tag, desiredReplicas int, activePodNames []string, force bool) error
ApplicationOCIResources(appName string) (map[string]resources.DockerImageDetails, error)
UpdateUnits(arg params.UpdateApplicationUnits) (*params.UpdateApplicationUnitsInfo, error)
WatchApplication(appName string) (watcher.NotifyWatcher, error)
}
CAASProvisionerFacade exposes CAAS provisioning functionality to a worker.
type Config ¶
type Config struct {
Facade CAASProvisionerFacade
Broker CAASBroker
ModelTag names.ModelTag
Clock clock.Clock
Logger Logger
NewAppWorker NewAppWorkerFunc
}
Config defines the operation of a Worker.
type Logger ¶
type Logger interface {
Debugf(string, ...interface{})
Infof(string, ...interface{})
Errorf(string, ...interface{})
Warningf(string, ...interface{})
Child(string) loggo.Logger
}
Logger represents the methods used by the worker to log details.
type ManifoldConfig ¶
type ManifoldConfig struct {
APICallerName string
BrokerName string
ClockName string
NewWorker func(Config) (worker.Worker, error)
Logger Logger
}
ManifoldConfig defines a CAAS operator provisioner's dependencies.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate is called by start to check for bad configuration.
type NewAppWorkerFunc ¶
type NewAppWorkerFunc func(AppWorkerConfig) func() (worker.Worker, error)
Click to show internal directories.
Click to hide internal directories.