Documentation
¶
Index ¶
- func MigrateFile(filePath, basePath string, options MigrationOptions, output io.Writer) error
- type Analyzer
- type MigrationIssue
- type MigrationOptions
- type MigrationReport
- func EnsureTypeInTags(notebookRoot string, options MigrationOptions, output io.Writer) (*MigrationReport, error)
- func Migrate(basePath string, options MigrationOptions, output io.Writer, ...) (*MigrationReport, error)
- func MigrateWorkspaces(sourceNotebookRoot, targetNotebookRoot string, renames map[string]string, ...) (*MigrationReport, error)
- func NewMigrationReport() *MigrationReport
- func RenameCurrentToInbox(notebookRoot string, options MigrationOptions, output io.Writer) (*MigrationReport, error)
- type MigrationScope
- type Migrator
- type StructuralMigration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MigrateFile ¶
func MigrateFile(filePath, basePath string, options MigrationOptions, output io.Writer) error
Types ¶
type Analyzer ¶
type Analyzer struct {
// contains filtered or unexported fields
}
func NewAnalyzer ¶
func (*Analyzer) AnalyzeNote ¶
func (a *Analyzer) AnalyzeNote(filePath string) ([]MigrationIssue, error)
type MigrationIssue ¶
type MigrationIssue struct {
Type string
Description string
Field string
Current interface{}
Expected interface{}
}
func AnalyzeFile ¶
func AnalyzeFile(filePath, basePath string) ([]MigrationIssue, error)
type MigrationOptions ¶
type MigrationOptions struct {
Scope MigrationScope
DryRun bool
Verbose bool
ShowReport bool
NoBackup bool
}
type MigrationReport ¶
type MigrationReport struct {
TotalFiles int
ProcessedFiles int
MigratedFiles int
SkippedFiles int
FailedFiles int
CreatedFiles int
DeletedFiles int
IssuesFixed int
Errors []string
ProcessingErrors map[string]error
StartTime time.Time
EndTime time.Time
}
func EnsureTypeInTags ¶
func EnsureTypeInTags(notebookRoot string, options MigrationOptions, output io.Writer) (*MigrationReport, error)
EnsureTypeInTags scans all notes in a notebook and ensures their note type is present in the tags array, matching the behavior of new note creation. Also handles converting "current" type to "inbox".
func Migrate ¶
func Migrate(basePath string, options MigrationOptions, output io.Writer, logger *logrus.Entry) (*MigrationReport, error)
func MigrateWorkspaces ¶
func MigrateWorkspaces(sourceNotebookRoot, targetNotebookRoot string, renames map[string]string, options MigrationOptions, output io.Writer) (*MigrationReport, error)
MigrateWorkspaces copies all files from old workspace names to new ones within notebooks, updating frontmatter fields like 'repository' and 'tags' for markdown files. Non-markdown files (logs, xml, yaml, etc.) are copied as-is.
func NewMigrationReport ¶
func NewMigrationReport() *MigrationReport
func RenameCurrentToInbox ¶
func RenameCurrentToInbox(notebookRoot string, options MigrationOptions, output io.Writer) (*MigrationReport, error)
RenameCurrentToInbox scans a notebook for directories named "current" and renames them to "inbox", updating the frontmatter of notes within.
func (*MigrationReport) Add ¶
func (r *MigrationReport) Add(other *MigrationReport)
Add merges another report's stats into this one.
func (*MigrationReport) AddError ¶
func (r *MigrationReport) AddError(file string, err error)
func (*MigrationReport) Complete ¶
func (r *MigrationReport) Complete()
func (*MigrationReport) Duration ¶
func (r *MigrationReport) Duration() time.Duration
type MigrationScope ¶
type Migrator ¶
type Migrator struct {
// contains filtered or unexported fields
}
func NewMigrator ¶
func (*Migrator) GetReport ¶
func (m *Migrator) GetReport() *MigrationReport
func (*Migrator) MigrateFile ¶
type StructuralMigration ¶
type StructuralMigration struct {
// contains filtered or unexported fields
}
StructuralMigration performs migration from old repos/{workspace}/{branch} structure to new notebooks/{workspace}/notes/{noteType} structure
func NewStructuralMigration ¶
func NewStructuralMigration(sourcePath, targetPath, globalRoot string, locator *coreworkspace.NotebookLocator, provider *coreworkspace.Provider, options MigrationOptions, isCopyOnly bool, output io.Writer) *StructuralMigration
NewStructuralMigration creates a new structural migration instance
func (*StructuralMigration) GetReport ¶
func (sm *StructuralMigration) GetReport() *MigrationReport
GetReport returns the migration report
func (*StructuralMigration) MigrateStructure ¶
func (sm *StructuralMigration) MigrateStructure() error
MigrateStructure performs the structural migration