Documentation
¶
Index ¶
- Variables
- func GetMigrationsFS() embed.FS
- func SeedMenu(ctx context.Context, opts SeedMenuOptions) error
- type ActivityConfig
- type BlockService
- type CacheConfig
- type Config
- type ContentConfig
- type ContentService
- type Features
- type GeneratorConfig
- type GeneratorService
- type I18NConfig
- type LoggingConfig
- type MarkdownConfig
- type MarkdownParserConfig
- type MediaService
- type MenuInfo
- type MenuItemInfo
- type MenuItemPath
- type MenuItemTranslationInput
- type MenuService
- type Module
- func (m *Module) Blocks() BlockService
- func (m *Module) Container() *di.Container
- func (m *Module) Content() ContentService
- func (m *Module) Generator() GeneratorService
- func (m *Module) Markdown() interfaces.MarkdownService
- func (m *Module) Media() MediaService
- func (m *Module) Menus() MenuService
- func (m *Module) Pages() PageService
- func (m *Module) Scheduler() interfaces.Scheduler
- func (m *Module) Shortcodes() interfaces.ShortcodeService
- func (m *Module) StorageAdmin() StorageAdminService
- func (m *Module) Themes() ThemeService
- func (m *Module) TranslationsEnabled() bool
- func (m *Module) TranslationsRequired() bool
- func (m *Module) Widgets() WidgetService
- func (m *Module) WorkflowEngine() interfaces.WorkflowEngine
- type NavigationConfig
- type NavigationNode
- type PageService
- type ReconcileMenuResult
- type RetentionConfig
- type SeedMenuItem
- type SeedMenuOptions
- type ShortcodeCacheConfig
- type ShortcodeConfig
- type ShortcodeDefinitionConfig
- type ShortcodeSecurityConfig
- type StorageAdminService
- type StorageConfig
- type ThemeConfig
- type ThemeService
- type URLKitResolverConfig
- type UpdateMenuItemByPathInput
- type UpsertMenuItemByPathInput
- type WidgetConfig
- type WidgetDefinitionConfig
- type WidgetService
- type WorkflowConfig
- type WorkflowDefinitionConfig
- type WorkflowStateConfig
- type WorkflowTransitionConfig
Constants ¶
This section is empty.
Variables ¶
var ( ErrThemesFeatureRequired = runtimeconfig.ErrThemesFeatureRequired ErrSchedulingFeatureRequiresVersioning = runtimeconfig.ErrSchedulingFeatureRequiresVersioning ErrAdvancedCacheRequiresEnabledCache = runtimeconfig.ErrAdvancedCacheRequiresEnabledCache ErrDefaultLocaleRequired = runtimeconfig.ErrDefaultLocaleRequired ErrLoggingProviderRequired = runtimeconfig.ErrLoggingProviderRequired ErrLoggingProviderUnknown = runtimeconfig.ErrLoggingProviderUnknown ErrLoggingLevelInvalid = runtimeconfig.ErrLoggingLevelInvalid ErrLoggingFormatInvalid = runtimeconfig.ErrLoggingFormatInvalid ErrActivityFeatureRequired = runtimeconfig.ErrActivityFeatureRequired ErrWorkflowProviderUnknown = runtimeconfig.ErrWorkflowProviderUnknown ErrWorkflowProviderConfiguredWhenDisabled = runtimeconfig.ErrWorkflowProviderConfiguredWhenDisabled )
var ( ErrMenuCodeRequired = errors.New("cms: menu code is required") ErrMenuItemPathRequired = errors.New("cms: menu item path is required") ErrMenuItemPathInvalid = errors.New("cms: menu item path is invalid") ErrMenuItemPathMismatch = errors.New("cms: menu item path does not match menu code") )
var ( ErrMenuNotFound = menus.ErrMenuNotFound ErrMenuInUse = menus.ErrMenuInUse )
Public menu errors.
var ErrSeedMenuServiceRequired = errors.New("cms: menu service is required")
Functions ¶
func GetMigrationsFS ¶ added in v0.2.0
GetMigrationsFS returns the embedded migration files for this package
Types ¶
type ActivityConfig ¶ added in v0.5.0
type ActivityConfig = runtimeconfig.ActivityConfig
type BlockService ¶
BlockService exports the blocks service contract.
type CacheConfig ¶
type CacheConfig = runtimeconfig.CacheConfig
type ContentConfig ¶
type ContentConfig = runtimeconfig.ContentConfig
type ContentService ¶
ContentService exports the content service contract for consumers of the cms package.
type Features ¶
type Features = runtimeconfig.Features
type GeneratorConfig ¶
type GeneratorConfig = runtimeconfig.GeneratorConfig
type GeneratorService ¶
GeneratorService exports the static site generator contract.
type I18NConfig ¶
type I18NConfig = runtimeconfig.I18NConfig
type LoggingConfig ¶
type LoggingConfig = runtimeconfig.LoggingConfig
type MarkdownConfig ¶
type MarkdownConfig = runtimeconfig.MarkdownConfig
type MarkdownParserConfig ¶
type MarkdownParserConfig = runtimeconfig.MarkdownParserConfig
type MediaService ¶
MediaService exports the media helper contract.
type MenuItemInfo ¶ added in v0.12.0
type MenuItemInfo struct {
Path string `json:"path"`
Type string `json:"type,omitempty"`
Position int `json:"position,omitempty"`
Target map[string]any `json:"target,omitempty"`
Icon string `json:"icon,omitempty"`
Badge map[string]any `json:"badge,omitempty"`
Permissions []string `json:"permissions,omitempty"`
Classes []string `json:"classes,omitempty"`
Styles map[string]string `json:"styles,omitempty"`
Collapsible bool `json:"collapsible,omitempty"`
Collapsed bool `json:"collapsed,omitempty"`
Metadata map[string]any `json:"metadata,omitempty"`
}
MenuItemInfo is a stable public view of a menu item record. Identity is always expressed via Path (external_code), never via UUID.
type MenuItemPath ¶ added in v0.12.0
MenuItemPath captures parsed information about a dot-path menu item identifier.
Example: - Path: "admin.content.pages" - MenuCode: "admin" - ParentPath:"admin.content" - Key: "pages"
func ParseMenuItemPath ¶ added in v0.12.0
func ParseMenuItemPath(path string) (MenuItemPath, error)
ParseMenuItemPath parses a dot-separated menu item path and derives menu code and parent path.
Invariants: - Path must include the menu code prefix and at least one item segment (min 2 segments). - No leading/trailing dots and no empty segments.
func ParseMenuItemPathForMenu ¶ added in v0.12.0
func ParseMenuItemPathForMenu(menuCode string, path string) (MenuItemPath, error)
ParseMenuItemPathForMenu validates that the provided path belongs to the given menu code.
type MenuItemTranslationInput ¶ added in v0.12.0
type MenuItemTranslationInput struct {
Locale string `json:"locale"`
Label string `json:"label,omitempty"`
LabelKey string `json:"label_key,omitempty"`
GroupTitle string `json:"group_title,omitempty"`
GroupTitleKey string `json:"group_title_key,omitempty"`
URLOverride *string `json:"url_override,omitempty"`
}
type MenuService ¶
type MenuService interface {
GetOrCreateMenu(ctx context.Context, code string, description *string, actor uuid.UUID) (*MenuInfo, error)
UpsertMenu(ctx context.Context, code string, description *string, actor uuid.UUID) (*MenuInfo, error)
GetMenuByCode(ctx context.Context, code string) (*MenuInfo, error)
ListMenuItemsByCode(ctx context.Context, menuCode string) ([]*MenuItemInfo, error)
ReconcileMenuByCode(ctx context.Context, menuCode string, actor uuid.UUID) (*ReconcileMenuResult, error)
ResetMenuByCode(ctx context.Context, code string, actor uuid.UUID, force bool) error
UpsertMenuItemByPath(ctx context.Context, input UpsertMenuItemByPathInput) (*MenuItemInfo, error)
UpdateMenuItemByPath(ctx context.Context, menuCode string, path string, input UpdateMenuItemByPathInput) (*MenuItemInfo, error)
DeleteMenuItemByPath(ctx context.Context, menuCode string, path string, actor uuid.UUID, cascadeChildren bool) error
UpsertMenuItemTranslationByPath(ctx context.Context, menuCode string, path string, input MenuItemTranslationInput) error
MoveMenuItemToTop(ctx context.Context, menuCode string, path string, actor uuid.UUID) error
MoveMenuItemToBottom(ctx context.Context, menuCode string, path string, actor uuid.UUID) error
MoveMenuItemBefore(ctx context.Context, menuCode string, path string, beforePath string, actor uuid.UUID) error
MoveMenuItemAfter(ctx context.Context, menuCode string, path string, afterPath string, actor uuid.UUID) error
SetMenuSiblingOrder(ctx context.Context, menuCode string, parentPath string, siblingPaths []string, actor uuid.UUID) error
}
MenuService is the public menus API for the cms package.
Identity rules: - Menus are addressed by code (e.g. "admin"). - Menu items are addressed by dot-paths (e.g. "admin.content.pages") and never by UUID.
UUIDs remain a persistence detail and must not be required for callers to use this API.
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Module represents the top level CMS runtime façade.
func (*Module) Blocks ¶
func (m *Module) Blocks() BlockService
Blocks returns the configured block service.
func (*Module) Content ¶
func (m *Module) Content() ContentService
Content returns the configured content service.
func (*Module) Generator ¶
func (m *Module) Generator() GeneratorService
Generator returns the configured generator service.
func (*Module) Markdown ¶
func (m *Module) Markdown() interfaces.MarkdownService
Markdown returns the markdown service when configured.
func (*Module) Media ¶
func (m *Module) Media() MediaService
Media returns the media helper used by the module.
func (*Module) Menus ¶
func (m *Module) Menus() MenuService
Menus returns the configured menu service.
func (*Module) Pages ¶
func (m *Module) Pages() PageService
Pages returns the configured page service.
func (*Module) Scheduler ¶
func (m *Module) Scheduler() interfaces.Scheduler
Scheduler returns the scheduler used for publish automation.
func (*Module) Shortcodes ¶ added in v0.2.0
func (m *Module) Shortcodes() interfaces.ShortcodeService
Shortcodes returns the configured shortcode service.
func (*Module) StorageAdmin ¶ added in v0.2.0
func (m *Module) StorageAdmin() StorageAdminService
StorageAdmin returns the storage admin helper service.
func (*Module) Themes ¶
func (m *Module) Themes() ThemeService
Themes returns the configured theme service.
func (*Module) TranslationsEnabled ¶ added in v0.2.0
TranslationsEnabled reports whether translations are globally enabled.
func (*Module) TranslationsRequired ¶ added in v0.2.0
TranslationsRequired reports whether translations are required when enabled.
func (*Module) Widgets ¶
func (m *Module) Widgets() WidgetService
Widgets returns the configured widget service.
func (*Module) WorkflowEngine ¶ added in v0.2.0
func (m *Module) WorkflowEngine() interfaces.WorkflowEngine
WorkflowEngine returns the configured workflow engine.
type NavigationConfig ¶
type NavigationConfig = runtimeconfig.NavigationConfig
type NavigationNode ¶ added in v0.12.0
type NavigationNode struct {
}
NavigationNode is a localized, presentation-ready navigation node. This type intentionally omits UUIDs; menu identity is expressed via menu codes and item paths.
type ReconcileMenuResult ¶ added in v0.12.0
type RetentionConfig ¶
type RetentionConfig = runtimeconfig.RetentionConfig
type SeedMenuItem ¶ added in v0.12.0
type SeedMenuItem struct {
Path string
Position *int
Type string
Target map[string]any
Icon string
Badge map[string]any
Permissions []string
Classes []string
Styles map[string]string
Collapsible bool
Collapsed bool
Metadata map[string]any
Translations []MenuItemTranslationInput
AllowMissingTranslations bool
}
type SeedMenuOptions ¶ added in v0.12.0
type SeedMenuOptions struct {
Menus MenuService
MenuCode string
Description *string
Locale string
Actor uuid.UUID
Items []SeedMenuItem
AutoCreateParents bool
// Ensure makes SeedMenu converge persisted menu items onto the provided spec.
// It performs reconciliation and enforces deterministic sibling ordering from the spec.
Ensure bool
// PruneUnspecified deletes menu items (by path) that exist in persistence but are not present in the spec.
// Deletions are performed by path and cascade through any descendant items.
PruneUnspecified bool
}
type ShortcodeCacheConfig ¶ added in v0.2.0
type ShortcodeCacheConfig = runtimeconfig.ShortcodeCacheConfig
type ShortcodeConfig ¶ added in v0.2.0
type ShortcodeConfig = runtimeconfig.ShortcodeConfig
type ShortcodeDefinitionConfig ¶ added in v0.2.0
type ShortcodeDefinitionConfig = runtimeconfig.ShortcodeDefinitionConfig
type ShortcodeSecurityConfig ¶ added in v0.2.0
type ShortcodeSecurityConfig = runtimeconfig.ShortcodeSecurityConfig
type StorageAdminService ¶ added in v0.2.0
type StorageAdminService = *adminstorage.Service
StorageAdminService exports the storage admin helper contract.
type StorageConfig ¶
type StorageConfig = runtimeconfig.StorageConfig
type ThemeConfig ¶
type ThemeConfig = runtimeconfig.ThemeConfig
type ThemeService ¶
ThemeService exports the themes service contract.
type URLKitResolverConfig ¶
type URLKitResolverConfig = runtimeconfig.URLKitResolverConfig
type UpdateMenuItemByPathInput ¶ added in v0.12.0
type UpdateMenuItemByPathInput struct {
ParentPath *string
Type *string
Target map[string]any
Icon *string
Badge map[string]any
Permissions []string
Classes []string
Styles map[string]string
Collapsible *bool
Collapsed *bool
Metadata map[string]any
// Position is a 0-based insertion index among siblings.
// Values past the end are clamped to append. Nil leaves the current position unchanged.
Position *int
Actor uuid.UUID
}
type UpsertMenuItemByPathInput ¶ added in v0.12.0
type UpsertMenuItemByPathInput struct {
Path string
ParentPath string
// Position is a 0-based insertion index among siblings.
// Values past the end are clamped to append. Nil defaults to append for new items.
Position *int
Type string
Target map[string]any
Icon string
Badge map[string]any
Permissions []string
Classes []string
Styles map[string]string
Collapsible bool
Collapsed bool
Metadata map[string]any
Translations []MenuItemTranslationInput
AllowMissingTranslations bool
Actor uuid.UUID
}
type WidgetConfig ¶
type WidgetConfig = runtimeconfig.WidgetConfig
type WidgetDefinitionConfig ¶
type WidgetDefinitionConfig = runtimeconfig.WidgetDefinitionConfig
type WidgetService ¶
WidgetService exports the widgets service contract.
type WorkflowConfig ¶ added in v0.2.0
type WorkflowConfig = runtimeconfig.WorkflowConfig
type WorkflowDefinitionConfig ¶ added in v0.2.0
type WorkflowDefinitionConfig = runtimeconfig.WorkflowDefinitionConfig
type WorkflowStateConfig ¶ added in v0.2.0
type WorkflowStateConfig = runtimeconfig.WorkflowStateConfig
type WorkflowTransitionConfig ¶ added in v0.2.0
type WorkflowTransitionConfig = runtimeconfig.WorkflowTransitionConfig
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
static
command
|
|
|
internal
|
|
|
markdown
Package markdown provides the concrete implementation of the Markdown ingestion workflows outlined in docs/FEAT_MARKDOWN.md.
|
Package markdown provides the concrete implementation of the Markdown ingestion workflows outlined in docs/FEAT_MARKDOWN.md. |
|
pkg
|
|
|
generator
Package generator exposes the static site generation API for go-cms hosts.
|
Package generator exposes the static site generation API for go-cms hosts. |