Documentation
¶
Index ¶
- Variables
- type Container
- func (c *Container) AdminBlockReadService() interfaces.AdminBlockReadService
- func (c *Container) AdminBlockWriteService() interfaces.AdminBlockWriteService
- func (c *Container) AdminContentReadService() interfaces.AdminContentReadService
- func (c *Container) AdminContentWriteService() interfaces.AdminContentWriteService
- func (c *Container) AdminPageReadService() interfaces.AdminPageReadService
- func (c *Container) AuditRecorder() jobs.AuditRecorder
- func (c *Container) AuthService() interfaces.AuthService
- func (c *Container) BlockAdminService() *adminblocks.Service
- func (c *Container) BlockService() blocks.Service
- func (c *Container) ContentRepository() content.ContentRepository
- func (c *Container) ContentService() content.Service
- func (c *Container) ContentTypeRepository() content.ContentTypeRepository
- func (c *Container) ContentTypeService() content.ContentTypeService
- func (c *Container) EnvironmentRepository() environments.EnvironmentRepository
- func (c *Container) EnvironmentService() environments.Service
- func (c *Container) GeneratorService() generator.Service
- func (c *Container) I18nService() i18n.Service
- func (c *Container) JobWorker() *jobs.Worker
- func (c *Container) LocaleRepository() content.LocaleRepository
- func (c *Container) LoggerProvider() interfaces.LoggerProvider
- func (c *Container) MarkdownService() interfaces.MarkdownService
- func (c *Container) MediaProvider() interfaces.MediaProvider
- func (c *Container) MediaService() media.Service
- func (c *Container) MenuService() menus.Service
- func (c *Container) PageRepository() pages.PageRepository
- func (c *Container) PageService() pages.Service
- func (c *Container) Scheduler() interfaces.Scheduler
- func (c *Container) ShortcodeRegistry() interfaces.ShortcodeRegistry
- func (c *Container) ShortcodeService() interfaces.ShortcodeService
- func (c *Container) StorageAdminService() *adminstorage.Service
- func (c *Container) StorageProvider() interfaces.StorageProvider
- func (c *Container) TemplateRenderer() interfaces.TemplateRenderer
- func (c *Container) ThemeService() themes.Service
- func (c *Container) TranslationAdminService() *admintranslations.Service
- func (c *Container) TranslationsEnabled() bool
- func (c *Container) TranslationsRequired() bool
- func (c *Container) WidgetService() widgets.Service
- func (c *Container) WorkflowEngine() interfaces.WorkflowEngine
- type Option
- func WithActivityHooks(hooks activity.Hooks) Option
- func WithActivitySink(sink interfaces.ActivitySink) Option
- func WithAuditRecorder(recorder jobs.AuditRecorder) Option
- func WithAuth(ap interfaces.AuthService) Option
- func WithBlockService(svc blocks.Service) Option
- func WithBunDB(db *bun.DB) Option
- func WithCache(service repocache.CacheService, serializer repocache.KeySerializer) Option
- func WithCacheProvider(provider interfaces.CacheProvider) Option
- func WithContentService(svc content.Service) Option
- func WithContentTypeService(svc content.ContentTypeService) Option
- func WithEnvironmentPermissionStrategy(strategy permissions.Strategy) Option
- func WithEnvironmentService(svc environments.Service) Option
- func WithGeneratorAssetResolver(resolver generator.AssetResolver) Option
- func WithGeneratorHooks(hooks generator.Hooks) Option
- func WithGeneratorOutput(output string) Option
- func WithGeneratorStorage(sp interfaces.StorageProvider) Option
- func WithI18nService(svc i18n.Service) Option
- func WithLifecycleHooks(hooks lifecycle.Hooks) Option
- func WithLoggerProvider(provider interfaces.LoggerProvider) Option
- func WithMarkdownService(svc interfaces.MarkdownService) Option
- func WithMedia(mp interfaces.MediaProvider) Option
- func WithMenuService(svc menus.Service) Option
- func WithPageService(svc pages.Service) Option
- func WithScheduler(s interfaces.Scheduler) Option
- func WithShortcodeCacheProvider(name string, provider interfaces.CacheProvider) Option
- func WithShortcodeMetrics(metrics interfaces.ShortcodeMetrics) Option
- func WithSlugNormalizer(normalizer slug.Normalizer) Option
- func WithStorage(sp interfaces.StorageProvider) Option
- func WithStorageFactory(kind string, factory StorageFactory) Option
- func WithStorageRepository(repo storageconfig.Repository) Option
- func WithTemplate(tr interfaces.TemplateRenderer) Option
- func WithThemeService(svc themes.Service) Option
- func WithTranslationSettingsRepository(repo translationconfig.Repository) Option
- func WithWidgetService(svc widgets.Service) Option
- func WithWorkflowDefinitionStore(store interfaces.WorkflowDefinitionStore) Option
- func WithWorkflowEngine(engine interfaces.WorkflowEngine) Option
- type StorageFactory
- type StorageFactoryResult
Constants ¶
This section is empty.
Variables ¶
var ErrEnvironmentPermissionStrategyRequired = errors.New("di: environment permission strategy resolver required")
ErrEnvironmentPermissionStrategyRequired is returned when a custom permission strategy is configured without a resolver.
var ErrWorkflowEngineNotProvided = errors.New("di: workflow engine required for custom workflow provider")
ErrWorkflowEngineNotProvided is returned when a custom workflow provider is configured without supplying an engine.
Functions ¶
This section is empty.
Types ¶
type Container ¶
type Container struct {
Config runtimeconfig.Config
// contains filtered or unexported fields
}
Container wires module dependencies. Phase 1 only returns no-op services.
func NewContainer ¶
func NewContainer(cfg runtimeconfig.Config, opts ...Option) (*Container, error)
NewContainer creates a container with the provided configuration.
func (*Container) AdminBlockReadService ¶ added in v0.45.0
func (c *Container) AdminBlockReadService() interfaces.AdminBlockReadService
AdminBlockReadService returns the configured admin block read service.
func (*Container) AdminBlockWriteService ¶ added in v0.45.0
func (c *Container) AdminBlockWriteService() interfaces.AdminBlockWriteService
AdminBlockWriteService returns the configured admin block write service.
func (*Container) AdminContentReadService ¶ added in v0.45.0
func (c *Container) AdminContentReadService() interfaces.AdminContentReadService
AdminContentReadService returns the configured admin content read service.
func (*Container) AdminContentWriteService ¶ added in v0.45.0
func (c *Container) AdminContentWriteService() interfaces.AdminContentWriteService
AdminContentWriteService returns the configured admin content write service.
func (*Container) AdminPageReadService ¶ added in v0.26.0
func (c *Container) AdminPageReadService() interfaces.AdminPageReadService
AdminPageReadService returns the configured admin page read service.
func (*Container) AuditRecorder ¶ added in v0.3.0
func (c *Container) AuditRecorder() jobs.AuditRecorder
AuditRecorder returns the audit recorder configured for scheduler instrumentation.
func (*Container) AuthService ¶
func (c *Container) AuthService() interfaces.AuthService
AuthService exposes the configured auth service.
func (*Container) BlockAdminService ¶ added in v0.21.0
func (c *Container) BlockAdminService() *adminblocks.Service
BlockAdminService exposes the embedded blocks admin helper.
func (*Container) BlockService ¶
BlockService returns the configured block service.
func (*Container) ContentRepository ¶
func (c *Container) ContentRepository() content.ContentRepository
ContentRepository exposes the configured content repository.
func (*Container) ContentService ¶
ContentService returns the configured content service.
func (*Container) ContentTypeRepository ¶
func (c *Container) ContentTypeRepository() content.ContentTypeRepository
ContentTypeRepository exposes the configured content-type repository.
func (*Container) ContentTypeService ¶ added in v0.20.0
func (c *Container) ContentTypeService() content.ContentTypeService
ContentTypeService returns the configured content type service.
func (*Container) EnvironmentRepository ¶ added in v0.23.1
func (c *Container) EnvironmentRepository() environments.EnvironmentRepository
EnvironmentRepository exposes the configured environment repository.
func (*Container) EnvironmentService ¶ added in v0.23.1
func (c *Container) EnvironmentService() environments.Service
EnvironmentService returns the configured environment service.
func (*Container) GeneratorService ¶
GeneratorService returns the configured static site generator service.
func (*Container) I18nService ¶
I18nService returns the configured i18n service (lazy).
func (*Container) JobWorker ¶ added in v0.3.0
JobWorker returns the worker responsible for replay audit commands.
func (*Container) LocaleRepository ¶
func (c *Container) LocaleRepository() content.LocaleRepository
LocaleRepository exposes the configured locale repository.
func (*Container) LoggerProvider ¶ added in v0.3.0
func (c *Container) LoggerProvider() interfaces.LoggerProvider
LoggerProvider returns the logger provider used by the container.
func (*Container) MarkdownService ¶
func (c *Container) MarkdownService() interfaces.MarkdownService
MarkdownService returns the configured markdown service.
func (*Container) MediaProvider ¶
func (c *Container) MediaProvider() interfaces.MediaProvider
MediaProvider exposes the configured media provider.
func (*Container) MediaService ¶
MediaService returns the configured media helper service.
func (*Container) MenuService ¶
MenuService returns the configured menu service.
func (*Container) PageRepository ¶
func (c *Container) PageRepository() pages.PageRepository
func (*Container) PageService ¶
PageService returns the configured page service.
func (*Container) Scheduler ¶
func (c *Container) Scheduler() interfaces.Scheduler
func (*Container) ShortcodeRegistry ¶ added in v0.2.0
func (c *Container) ShortcodeRegistry() interfaces.ShortcodeRegistry
ShortcodeRegistry exposes the shortcode registry when the feature is enabled.
func (*Container) ShortcodeService ¶ added in v0.2.0
func (c *Container) ShortcodeService() interfaces.ShortcodeService
ShortcodeService exposes the shortcode rendering service when enabled.
func (*Container) StorageAdminService ¶ added in v0.2.0
func (c *Container) StorageAdminService() *adminstorage.Service
StorageAdminService exposes the storage admin helper.
func (*Container) StorageProvider ¶
func (c *Container) StorageProvider() interfaces.StorageProvider
StorageProvider exposes the configured storage implementation.
func (*Container) TemplateRenderer ¶
func (c *Container) TemplateRenderer() interfaces.TemplateRenderer
TemplateRenderer exposes the configured template renderer.
func (*Container) ThemeService ¶
func (*Container) TranslationAdminService ¶ added in v0.16.0
func (c *Container) TranslationAdminService() *admintranslations.Service
TranslationAdminService exposes the translation settings admin helper.
func (*Container) TranslationsEnabled ¶ added in v0.2.0
TranslationsEnabled reports whether translation handling is globally enabled.
func (*Container) TranslationsRequired ¶ added in v0.2.0
TranslationsRequired reports whether translations must be provided when enabled.
func (*Container) WidgetService ¶
WidgetService returns the configured widget service.
func (*Container) WorkflowEngine ¶ added in v0.2.0
func (c *Container) WorkflowEngine() interfaces.WorkflowEngine
WorkflowEngine returns the configured workflow engine (may be nil when disabled).
type Option ¶
type Option func(*Container)
Option mutates the container before it is finalised.
func WithActivityHooks ¶ added in v0.5.0
WithActivityHooks appends hooks that will receive activity events.
func WithActivitySink ¶ added in v0.5.0
func WithActivitySink(sink interfaces.ActivitySink) Option
WithActivitySink overrides the activity sink used for activity emissions.
func WithAuditRecorder ¶
func WithAuditRecorder(recorder jobs.AuditRecorder) Option
WithAuditRecorder overrides the audit recorder used by audit commands and worker instrumentation.
func WithAuth ¶
func WithAuth(ap interfaces.AuthService) Option
WithAuth overrides the default auth provider.
func WithBlockService ¶
WithBlockService overrides the default page service binding.
func WithCache ¶
func WithCache(service repocache.CacheService, serializer repocache.KeySerializer) Option
WithCache overrides the default cache provider.
func WithCacheProvider ¶
func WithCacheProvider(provider interfaces.CacheProvider) Option
func WithContentService ¶
WithContentService overrides the default content service binding.
func WithContentTypeService ¶ added in v0.20.0
func WithContentTypeService(svc content.ContentTypeService) Option
WithContentTypeService overrides the default content type service binding.
func WithEnvironmentPermissionStrategy ¶ added in v0.23.1
func WithEnvironmentPermissionStrategy(strategy permissions.Strategy) Option
WithEnvironmentPermissionStrategy overrides the environment permission strategy resolver.
func WithEnvironmentService ¶ added in v0.23.1
func WithEnvironmentService(svc environments.Service) Option
WithEnvironmentService overrides the default environment service binding.
func WithGeneratorAssetResolver ¶
func WithGeneratorAssetResolver(resolver generator.AssetResolver) Option
WithGeneratorAssetResolver overrides the asset resolver used during static builds.
func WithGeneratorHooks ¶
WithGeneratorHooks registers lifecycle hooks for generator operations.
func WithGeneratorOutput ¶
WithGeneratorOutput overrides the generator output directory.
func WithGeneratorStorage ¶
func WithGeneratorStorage(sp interfaces.StorageProvider) Option
WithGeneratorStorage overrides the storage provider used by the generator.
func WithI18nService ¶
WithI18nService overrides the default i18n service binding.
func WithLifecycleHooks ¶ added in v0.43.0
WithLifecycleHooks appends hooks that will receive root-record lifecycle events.
func WithLoggerProvider ¶
func WithLoggerProvider(provider interfaces.LoggerProvider) Option
WithLoggerProvider overrides the logger provider used to construct command loggers.
func WithMarkdownService ¶
func WithMarkdownService(svc interfaces.MarkdownService) Option
func WithMedia ¶
func WithMedia(mp interfaces.MediaProvider) Option
WithMedia overrides the default media provider.
func WithMenuService ¶
func WithPageService ¶
WithPageService overrides the default page service binding.
func WithScheduler ¶
func WithScheduler(s interfaces.Scheduler) Option
func WithShortcodeCacheProvider ¶ added in v0.2.0
func WithShortcodeCacheProvider(name string, provider interfaces.CacheProvider) Option
WithShortcodeCacheProvider registers a cache provider that can be selected for shortcodes. When name is empty, the provider is used as the default shortcode cache.
func WithShortcodeMetrics ¶ added in v0.2.0
func WithShortcodeMetrics(metrics interfaces.ShortcodeMetrics) Option
WithShortcodeMetrics overrides the metrics recorder used by the shortcode service.
func WithSlugNormalizer ¶ added in v0.20.0
func WithSlugNormalizer(normalizer slug.Normalizer) Option
WithSlugNormalizer overrides the default slug normalizer used by services.
func WithStorage ¶
func WithStorage(sp interfaces.StorageProvider) Option
WithStorage overrides the default storage provider.
func WithStorageFactory ¶ added in v0.2.0
func WithStorageFactory(kind string, factory StorageFactory) Option
WithStorageFactory registers a storage provider factory under the given kind.
func WithStorageRepository ¶ added in v0.2.0
func WithStorageRepository(repo storageconfig.Repository) Option
WithStorageRepository overrides the storage profile repository used for runtime configuration.
func WithTemplate ¶
func WithTemplate(tr interfaces.TemplateRenderer) Option
WithTemplate overrides the default template renderer.
func WithThemeService ¶
func WithTranslationSettingsRepository ¶ added in v0.16.0
func WithTranslationSettingsRepository(repo translationconfig.Repository) Option
WithTranslationSettingsRepository overrides the translation settings repository used for runtime configuration.
func WithWidgetService ¶
func WithWorkflowDefinitionStore ¶ added in v0.2.0
func WithWorkflowDefinitionStore(store interfaces.WorkflowDefinitionStore) Option
WithWorkflowDefinitionStore registers an external source for workflow definitions.
func WithWorkflowEngine ¶ added in v0.2.0
func WithWorkflowEngine(engine interfaces.WorkflowEngine) Option
WithWorkflowEngine overrides the workflow engine used by the module.
type StorageFactory ¶ added in v0.2.0
type StorageFactory func(ctx context.Context, profile storage.Profile) (StorageFactoryResult, error)
StorageFactory constructs storage providers and their backing handles for a profile.
type StorageFactoryResult ¶ added in v0.2.0
type StorageFactoryResult struct {
Provider interfaces.StorageProvider
BunDB *bun.DB
Closer func(context.Context) error
}
StorageFactoryResult captures the outcome of a storage factory invocation.