Documentation
¶
Overview ¶
Package migrator provides a module for migrating content from other CMS platforms to oCMS. It supports multiple source systems through a pluggable importer architecture.
Index ¶
- func RegisterSource(s Source)
- type ConfigField
- type ImportOptions
- type ImportResult
- type ImportTracker
- type ListSourcesData
- type Module
- func (m *Module) AdminURL() string
- func (m *Module) Init(ctx *module.Context) error
- func (m *Module) Migrations() []module.Migration
- func (m *Module) RegisterAdminRoutes(r chi.Router)
- func (m *Module) RegisterRoutes(_ chi.Router)
- func (m *Module) Shutdown() error
- func (m *Module) SidebarLabel() string
- func (m *Module) TemplateFuncs() template.FuncMap
- func (m *Module) TrackImportedItem(ctx context.Context, source, entityType string, entityID int64) error
- func (m *Module) TranslationsFS() embed.FS
- type Source
- type SourceFormData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterSource ¶
func RegisterSource(s Source)
RegisterSource registers a source with the registry.
Types ¶
type ConfigField ¶
type ConfigField = types.ConfigField
Type aliases for convenience - allows using migrator.Source instead of types.Source
type ImportOptions ¶
type ImportOptions = types.ImportOptions
Type aliases for convenience - allows using migrator.Source instead of types.Source
type ImportResult ¶
type ImportResult = types.ImportResult
Type aliases for convenience - allows using migrator.Source instead of types.Source
type ImportTracker ¶
type ImportTracker = types.ImportTracker
Type aliases for convenience - allows using migrator.Source instead of types.Source
type ListSourcesData ¶
type ListSourcesData struct {
Sources []Source
}
ListSourcesData contains data for the source list template.
type Module ¶
type Module struct {
module.BaseModule
// contains filtered or unexported fields
}
Module implements the module.Module interface for the migrator module.
func (*Module) Migrations ¶
Migrations returns database migrations for the module.
func (*Module) RegisterAdminRoutes ¶
RegisterAdminRoutes registers admin routes for the module.
func (*Module) RegisterRoutes ¶
RegisterRoutes registers public routes for the module.
func (*Module) SidebarLabel ¶
SidebarLabel returns the display label for the admin sidebar.
func (*Module) TemplateFuncs ¶
TemplateFuncs returns template functions provided by the module.
func (*Module) TrackImportedItem ¶
func (m *Module) TrackImportedItem(ctx context.Context, source, entityType string, entityID int64) error
TrackImportedItem records an imported item for later deletion.
func (*Module) TranslationsFS ¶
TranslationsFS returns the embedded filesystem containing module translations.
type Source ¶
Type aliases for convenience - allows using migrator.Source instead of types.Source
func ListSources ¶
func ListSources() []Source
ListSources returns all registered sources sorted by name.
type SourceFormData ¶
type SourceFormData struct {
Source Source
ConfigFields []ConfigField
Config map[string]string
ImportedCounts map[string]int // Counts of imported items by entity type
}
SourceFormData contains data for the source form template.