Documentation
¶
Index ¶
- func Manifold(config ManifoldConfig) dependency.Manifold
- func NewMetricsCollector() *apiserver.Collector
- func NewWorker(ctx context.Context, config Config) (worker.Worker, error)
- type Config
- type ControllerConfigService
- type GetControllerConfigServiceFunc
- type GetModelServiceFunc
- type HTTPClient
- type ManifoldConfig
- type ModelService
- type NewServerFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Manifold ¶
func Manifold(config ManifoldConfig) dependency.Manifold
Manifold returns a dependency.Manifold that will run an apiserver worker. The manifold outputs an *apiserverhttp.Mux, for other workers to register handlers against.
func NewMetricsCollector ¶
NewMetricsCollector returns a new apiserver collector
Types ¶
type Config ¶
type Config struct {
AgentConfig agent.Config
Clock clock.Clock
Hub *pubsub.StructuredHub
Presence presence.Recorder
Mux *apiserverhttp.Mux
LocalMacaroonAuthenticator macaroon.LocalMacaroonAuthenticator
StatePool *state.StatePool
LeaseManager lease.Manager
LogSink corelogger.ModelLogger
RegisterIntrospectionHTTPHandlers func(func(path string, _ http.Handler))
UpgradeComplete func() bool
GetAuditConfig func() auditlog.Config
NewServer NewServerFunc
MetricsCollector *apiserver.Collector
EmbeddedCommand apiserver.ExecEmbeddedCommandFunc
CharmhubHTTPClient HTTPClient
// DBGetter supplies WatchableDB implementations by namespace.
DBGetter changestream.WatchableDBGetter
DBDeleter database.DBDeleter
DomainServicesGetter services.DomainServicesGetter
TracerGetter trace.TracerGetter
ObjectStoreGetter objectstore.ObjectStoreGetter
ControllerConfigService ControllerConfigService
ModelService ModelService
}
Config is the configuration required for running an API server worker.
type ControllerConfigService ¶
type ControllerConfigService interface {
// ControllerConfig returns the current controller configuration.
ControllerConfig(context.Context) (controller.Config, error)
}
ControllerConfigService is the interface that the worker uses to get the controller configuration.
func GetControllerConfigService ¶
func GetControllerConfigService(getter dependency.Getter, name string) (ControllerConfigService, error)
GetControllerConfigService is a helper function that gets a ControllerConfigService from the manifold.
type GetControllerConfigServiceFunc ¶
type GetControllerConfigServiceFunc func(getter dependency.Getter, name string) (ControllerConfigService, error)
GetControllerConfigServiceFunc is a helper function that gets a ControllerConfigService from the manifold.
type GetModelServiceFunc ¶
type GetModelServiceFunc func(getter dependency.Getter, name string) (ModelService, error)
GetModelServiceFunc is a helper function that gets a ModelService from the manifold.
type ManifoldConfig ¶
type ManifoldConfig struct {
AgentName string
AuthenticatorName string
ClockName string
MuxName string
StateName string
UpgradeGateName string
AuditConfigUpdaterName string
LeaseManagerName string
LogSinkName string
HTTPClientName string
DBAccessorName string
ChangeStreamName string
DomainServicesName string
TraceName string
ObjectStoreName string
PrometheusRegisterer prometheus.Registerer
RegisterIntrospectionHTTPHandlers func(func(path string, _ http.Handler))
Hub *pubsub.StructuredHub
Presence presence.Recorder
GetControllerConfigService GetControllerConfigServiceFunc
GetModelService GetModelServiceFunc
NewWorker func(context.Context, Config) (worker.Worker, error)
NewMetricsCollector func() *apiserver.Collector
}
ManifoldConfig holds the information necessary to run an apiserver worker in a dependency.Engine.
func (ManifoldConfig) Validate ¶
func (config ManifoldConfig) Validate() error
Validate validates the manifold configuration.
type ModelService ¶
type ModelService interface {
// ControllerModel returns information for the controller model.
ControllerModel(context.Context) (model.Model, error)
}
ModelService is the interface that the worker uses to get model information.
func GetModelService ¶
func GetModelService(getter dependency.Getter, name string) (ModelService, error)
GetModelService is a helper function that gets a ModelService from the manifold.
type NewServerFunc ¶
NewServerFunc is the type of function that will be used by the worker to create a new API server.