internal

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyFile

func CopyFile(src, dst string) error

func ExpandHome

func ExpandHome(path string) string

func RelPath

func RelPath(path, base string) string

func ResolveTargetHome

func ResolveTargetHome(override string) (string, error)

func ResolveWorkspace

func ResolveWorkspace(homeDir string) string

Types

type Action

type Action struct {
	Type        ActionType
	Source      string
	Target      string
	Description string
}

func PlanWorkspaceMigration

func PlanWorkspaceMigration(
	srcWorkspace, dstWorkspace string,
	migrateableFiles []string,
	migrateableDirs []string,
	force bool,
) ([]Action, error)

type ActionType

type ActionType int
const (
	ActionCopy ActionType = iota
	ActionSkip
	ActionBackup
	ActionConvertConfig
	ActionCreateDir
	ActionMergeConfig
)

type HandlerFactory

type HandlerFactory func(opts Options) Operation

type Operation

type Operation interface {
	GetSourceName() string
	GetSourceHome() (string, error)
	GetSourceWorkspace() (string, error)
	GetSourceConfigFile() (string, error)
	ExecuteConfigMigration(srcConfigPath, dstConfigPath string) error
	GetMigrateableFiles() []string
	GetMigrateableDirs() []string
}

type Options

type Options struct {
	DryRun        bool
	ConfigOnly    bool
	WorkspaceOnly bool
	Force         bool
	Refresh       bool
	Source        string
	SourceHome    string
	TargetHome    string
}

type Result

type Result struct {
	FilesCopied    int
	FilesSkipped   int
	BackupsCreated int
	ConfigMigrated bool
	DirsCreated    int
	Warnings       []string
	Errors         []error
}

Jump to

Keyboard shortcuts

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