migrator

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: GPL-3.0 Imports: 18 Imported by: 0

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

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 New

func New() *Module

New creates a new instance of the migrator module.

func (*Module) AdminURL

func (m *Module) AdminURL() string

AdminURL returns the admin dashboard URL for the module.

func (*Module) Init

func (m *Module) Init(ctx *module.Context) error

Init initializes the module with the given context.

func (*Module) Migrations

func (m *Module) Migrations() []module.Migration

Migrations returns database migrations for the module.

func (*Module) RegisterAdminRoutes

func (m *Module) RegisterAdminRoutes(r chi.Router)

RegisterAdminRoutes registers admin routes for the module.

func (*Module) RegisterRoutes

func (m *Module) RegisterRoutes(_ chi.Router)

RegisterRoutes registers public routes for the module.

func (*Module) Shutdown

func (m *Module) Shutdown() error

Shutdown performs cleanup when the module is shutting down.

func (*Module) SidebarLabel

func (m *Module) SidebarLabel() string

SidebarLabel returns the display label for the admin sidebar.

func (*Module) TemplateFuncs

func (m *Module) TemplateFuncs() template.FuncMap

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

func (m *Module) TranslationsFS() embed.FS

TranslationsFS returns the embedded filesystem containing module translations.

type Source

type Source = types.Source

Type aliases for convenience - allows using migrator.Source instead of types.Source

func GetSource

func GetSource(name string) (Source, bool)

GetSource returns a source by name.

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.

Directories

Path Synopsis
sources
Package types defines shared types for the migrator module.
Package types defines shared types for the migrator module.

Jump to

Keyboard shortcuts

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