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 MigratorListPage(pc *adminviews.PageContext, data MigratorListViewData) templ.Component
- func MigratorSourceFormPage(pc *adminviews.PageContext, data MigratorSourceFormViewData) templ.Component
- func RegisterSource(s Source)
- type ConfigField
- type ImportOptions
- type ImportResult
- type ImportTracker
- type MigratorListViewData
- type MigratorSourceFormViewData
- type MigratorSourceView
- 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
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigratorListPage ¶ added in v0.9.0
func MigratorListPage(pc *adminviews.PageContext, data MigratorListViewData) templ.Component
func MigratorSourceFormPage ¶ added in v0.9.0
func MigratorSourceFormPage(pc *adminviews.PageContext, data MigratorSourceFormViewData) templ.Component
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 MigratorListViewData ¶ added in v0.9.0
type MigratorListViewData struct {
Sources []MigratorSourceView
}
MigratorListViewData holds data for the migrator source list page.
type MigratorSourceFormViewData ¶ added in v0.9.0
type MigratorSourceFormViewData struct {
SourceName string
DisplayName string
Description string
ConfigFields []ConfigField
Config map[string]string
ImportedCounts map[string]int
}
MigratorSourceFormViewData holds data for the migrator source form page.
type MigratorSourceView ¶ added in v0.9.0
MigratorSourceView is a view-friendly representation of a Source.
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.