runtimeconfig

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrActivityFeatureRequired = errors.New("cms config: activity feature must be enabled to configure activity")
View Source
var ErrAdvancedCacheRequiresEnabledCache = errors.New("cms config: advanced cache feature requires cache to be enabled")

ErrAdvancedCacheRequiresEnabledCache ensures advanced cache builds only when cache is enabled.

View Source
var ErrDefaultLocaleRequired = errors.New("cms config: default locale is required when translations are enforced")
View Source
var ErrGeneratorOutputDirRequired = errors.New("cms config: generator output directory is required when generator is enabled")
View Source
var ErrLoggingFormatInvalid = errors.New("cms config: logging format is invalid")
View Source
var ErrLoggingLevelInvalid = errors.New("cms config: logging level is invalid")
View Source
var ErrLoggingProviderRequired = errors.New("cms config: logging provider is required when logging feature is enabled")
View Source
var ErrLoggingProviderUnknown = errors.New("cms config: logging provider is invalid")
View Source
var ErrMarkdownContentDirRequired = errors.New("cms config: markdown content directory is required when markdown is enabled")
View Source
var ErrMarkdownFeatureRequired = errors.New("cms config: markdown feature must be enabled to configure markdown")
View Source
var ErrSchedulingFeatureRequiresVersioning = errors.New("cms config: scheduling feature requires versioning to be enabled")

ErrSchedulingFeatureRequiresVersioning ensures scheduling stays behind the versioning flag.

View Source
var ErrShortcodesFeatureRequired = errors.New("cms config: shortcodes feature must be enabled to configure shortcodes")
View Source
var ErrStorageProfileAliasCollides = errors.New("cms config: storage profile alias collides with existing profile")
View Source
var ErrStorageProfileAliasDuplicate = errors.New("cms config: storage profile alias must be unique")
View Source
var ErrStorageProfileAliasInvalid = errors.New("cms config: storage profile alias is invalid")
View Source
var ErrStorageProfileAliasNameRequired = errors.New("cms config: storage profile alias name is required")
View Source
var ErrStorageProfileAliasTargetRequired = errors.New("cms config: storage profile alias target is required")
View Source
var ErrStorageProfileAliasTargetUnknown = errors.New("cms config: storage profile alias target is unknown")
View Source
var ErrStorageProfileConfigDSNRequired = errors.New("cms config: storage profile config DSN is required")
View Source
var ErrStorageProfileConfigDriverRequired = errors.New("cms config: storage profile config driver is required")
View Source
var ErrStorageProfileConfigNameRequired = errors.New("cms config: storage profile config name is required")
View Source
var ErrStorageProfileDuplicateName = errors.New("cms config: storage profile name must be unique")
View Source
var ErrStorageProfileFallbackEmpty = errors.New("cms config: storage profile fallback cannot be empty")
View Source
var ErrStorageProfileFallbackSelf = errors.New("cms config: storage profile fallback cannot reference the same profile")
View Source
var ErrStorageProfileFallbackUnknown = errors.New("cms config: storage profile fallback references unknown profile")
View Source
var ErrStorageProfileMultipleDefaults = errors.New("cms config: storage profile default must be unique")
View Source
var ErrStorageProfileNameInvalid = errors.New("cms config: storage profile name is invalid")
View Source
var ErrStorageProfileNameRequired = errors.New("cms config: storage profile name is required")
View Source
var ErrStorageProfileProviderRequired = errors.New("cms config: storage profile provider is required")
View Source
var ErrThemesFeatureRequired = errors.New("cms config: themes feature must be enabled to configure themes")

ErrThemesFeatureRequired indicates inconsistent theme configuration.

View Source
var ErrVersionRetentionLimitInvalid = errors.New("cms config: version retention limit must be zero or positive")
View Source
var ErrWorkflowProviderConfiguredWhenDisabled = errors.New("cms config: workflow provider configured while workflow disabled")
View Source
var ErrWorkflowProviderUnknown = errors.New("cms config: workflow provider is invalid")

Functions

This section is empty.

Types

type ActivityConfig added in v0.5.0

type ActivityConfig struct {
	Enabled bool
	Channel string
}

ActivityConfig controls activity emission defaults.

type CacheConfig

type CacheConfig struct {
	Enabled    bool
	DefaultTTL time.Duration
}

CacheConfig captures cache behaviour toggles.

type Config

type Config struct {
	Enabled       bool
	DefaultLocale string
	Content       ContentConfig
	I18N          I18NConfig
	Storage       StorageConfig
	Cache         CacheConfig
	Menus         MenusConfig
	Navigation    NavigationConfig
	Themes        ThemeConfig
	Widgets       WidgetConfig
	Retention     RetentionConfig
	Features      Features
	Shortcodes    ShortcodeConfig
	Markdown      MarkdownConfig
	Generator     GeneratorConfig
	Logging       LoggingConfig
	Workflow      WorkflowConfig
	Activity      ActivityConfig
}

Config aggregates feature flags and adapter bindings for the CMS module. Fields intentionally use simple types so host applications can extend them later.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns opinionated defaults matching Phase 1 expectations.

func (Config) Validate

func (cfg Config) Validate() error

Validate performs high-level consistency checks.

type ContentConfig

type ContentConfig struct {
	PageHierarchy bool
}

ContentConfig captures configuration for the core content module.

type Features

type Features struct {
	Widgets       bool
	Themes        bool
	Versioning    bool
	Scheduling    bool
	MediaLibrary  bool
	AdvancedCache bool
	Markdown      bool
	Logger        bool
	Shortcodes    bool
	Activity      bool
}

Features toggles module functionality.

type GeneratorConfig

type GeneratorConfig struct {
	Enabled          bool
	OutputDir        string
	BaseURL          string
	CleanBuild       bool
	Incremental      bool
	CopyAssets       bool
	GenerateSitemap  bool
	GenerateRobots   bool
	GenerateFeeds    bool
	Workers          int
	Menus            map[string]string
	RenderTimeout    time.Duration
	AssetCopyTimeout time.Duration
}

GeneratorConfig captures behaviour for the static site generator.

type I18NConfig

type I18NConfig struct {
	Enabled               bool
	Locales               []string
	RequireTranslations   bool
	DefaultLocaleRequired bool
}

I18NConfig wires go-i18n options through the CMS wrapper.

type LoggingConfig

type LoggingConfig struct {
	Provider  string
	Level     string
	Format    string
	AddSource bool
	Focus     []string
}

LoggingConfig captures provider-specific options for runtime logging.

type MarkdownConfig

type MarkdownConfig struct {
	Enabled           bool
	ContentDir        string
	Pattern           string
	Recursive         bool
	LocalePatterns    map[string]string
	DefaultLocale     string
	Locales           []string
	Parser            MarkdownParserConfig
	ProcessShortcodes bool
}

MarkdownConfig captures filesystem and parser behaviour for Markdown ingestion.

type MarkdownParserConfig

type MarkdownParserConfig struct {
	Extensions []string
	Sanitize   bool
	HardWraps  bool
	SafeMode   bool
}

MarkdownParserConfig mirrors interfaces.ParseOptions for runtime configuration.

type MenusConfig struct {
	// AllowOutOfOrderUpserts enables order-independent menu bootstraps:
	// missing parents are deferred, collapsible intent can be persisted before children exist,
	// and reconciliation runs automatically after writes (and before navigation resolution).
	AllowOutOfOrderUpserts bool
}

MenusConfig captures menu write semantics that influence bootstrap/upsert behavior.

type NavigationConfig struct {
	RouteConfig *urlkit.Config
	URLKit      URLKitResolverConfig
}

NavigationConfig captures routing configuration for menu URL resolution.

type RetentionConfig

type RetentionConfig struct {
	Content int
	Pages   int
	Blocks  int
}

RetentionConfig captures per-module version retention limits.

type ShortcodeCacheConfig added in v0.2.0

type ShortcodeCacheConfig struct {
	Enabled      bool
	Provider     string
	DefaultTTL   time.Duration
	PerShortcode map[string]time.Duration
}

ShortcodeCacheConfig configures caching hints for shortcode output.

type ShortcodeConfig added in v0.2.0

type ShortcodeConfig struct {
	Enabled               bool
	EnableWordPressSyntax bool
	BuiltIns              []string
	CustomDefinitions     []ShortcodeDefinitionConfig
	Security              ShortcodeSecurityConfig
	Cache                 ShortcodeCacheConfig
}

ShortcodeConfig captures runtime toggles for shortcode processing.

type ShortcodeDefinitionConfig added in v0.2.0

type ShortcodeDefinitionConfig struct {
	Name     string
	Template string
	Schema   map[string]any
}

ShortcodeDefinitionConfig allows hosts to register additional shortcode templates via configuration.

type ShortcodeSecurityConfig added in v0.2.0

type ShortcodeSecurityConfig struct {
	AllowedDomains     []string
	MaxNestingDepth    int
	MaxExecutionTime   time.Duration
	SanitizeOutput     bool
	CSPEnabled         bool
	RateLimitPerMinute int
}

ShortcodeSecurityConfig wires sanitisation and execution-guard controls.

type StorageConfig

type StorageConfig struct {
	Provider string
	Profiles []storage.Profile
	Aliases  map[string]string
}

StorageConfig lists identifiers for storage-related dependencies.

func (StorageConfig) ValidateProfiles added in v0.2.0

func (cfg StorageConfig) ValidateProfiles() error

ValidateProfiles ensures storage profiles and their aliases are well-formed.

type ThemeConfig

type ThemeConfig struct {
	BasePath          string
	DefaultTheme      string
	DefaultVariant    string
	PartialFallbacks  map[string]string
	CSSVariablePrefix string
}

ThemeConfig captures configuration for the themes module.

type URLKitResolverConfig

type URLKitResolverConfig struct {
	DefaultGroup  string
	LocaleGroups  map[string]string
	DefaultRoute  string
	SlugParam     string
	LocaleParam   string
	LocaleIDParam string
	RouteField    string
	ParamsField   string
	QueryField    string
}

URLKitResolverConfig configures the go-urlkit based resolver.

type WidgetConfig

type WidgetConfig struct {
	Definitions []WidgetDefinitionConfig
}

WidgetConfig controls registry bootstrapping.

type WidgetDefinitionConfig

type WidgetDefinitionConfig struct {
	Name        string
	Description string
	Schema      map[string]any
	Defaults    map[string]any
	Category    string
	Icon        string
}

WidgetDefinitionConfig mirrors the minimal RegisterDefinitionInput requirements.

type WorkflowConfig added in v0.2.0

type WorkflowConfig struct {
	Enabled     bool
	Provider    string
	Definitions []WorkflowDefinitionConfig
}

WorkflowConfig captures workflow engine configuration.

type WorkflowDefinitionConfig added in v0.2.0

type WorkflowDefinitionConfig struct {
	Entity      string
	Description string
	States      []WorkflowStateConfig
	Transitions []WorkflowTransitionConfig
}

WorkflowDefinitionConfig documents a workflow definition sourced from configuration.

type WorkflowStateConfig added in v0.2.0

type WorkflowStateConfig struct {
	Name        string
	Description string
	Terminal    bool
	Initial     bool
}

WorkflowStateConfig describes a workflow state.

type WorkflowTransitionConfig added in v0.2.0

type WorkflowTransitionConfig struct {
	Name        string
	Description string
	From        string
	To          string
	Guard       string
}

WorkflowTransitionConfig describes a workflow transition.

Jump to

Keyboard shortcuts

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