migration

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RewriteReport

type RewriteReport struct {
	Scanned            int
	Matched            int
	Rewritten          int
	SkippedWrongPrefix int      // symlinks whose target didn't point at sourceMountPath/.ids/ — usually a misconfigured mount path
	Unmatched          []string // symlink paths that had no matching migration row
	Errors             []string // errors encountered (non-fatal)
}

RewriteReport summarizes results of a symlink rewrite operation.

func RewriteLibrarySymlinks(
	ctx context.Context,
	libraryPath string,
	sourceMountPath string,
	altmountPath string,
	source string,
	lookup SymlinkLookup,
	dryRun bool,
) (*RewriteReport, error)

RewriteLibrarySymlinks walks libraryPath, finds symlinks (real OS symlinks or rclone .rclonelink text files) whose target starts with sourceMountPath+"/.ids/", looks up the GUID in the lookup, and rewrites the target to filepath.Join(altmountPath, finalPath).

If dryRun is true, no filesystem changes are made but the report is populated.

type SymlinkLookup

type SymlinkLookup interface {
	LookupFinalPath(ctx context.Context, source, externalID string) (finalPath string, found bool, err error)
	MarkSymlinksMigrated(ctx context.Context, ids []int64) error
}

SymlinkLookup looks up the final AltMount path for a given source and external ID.

Jump to

Keyboard shortcuts

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