migrate

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GenerateOptions

type GenerateOptions struct {
	Mode       MigrationMode
	OutputRoot string
	Apply      bool
}

type GenerateResult

type GenerateResult struct {
	OutputRoot        string   `json:"output_root"`
	GeneratedCommands int      `json:"generated_commands"`
	GeneratedFiles    []string `json:"generated_files,omitempty"`
}

func Generate

func Generate(plan Plan, opts GenerateOptions) (GenerateResult, error)

type MigrationMode

type MigrationMode string
const (
	ModeSafe    MigrationMode = "safe"
	ModeInPlace MigrationMode = "in-place"
)

type MigrationStrategy

type MigrationStrategy string
const (
	StrategyAuto    MigrationStrategy = "auto"
	StrategyWrapper MigrationStrategy = "wrapper"
	StrategyManual  MigrationStrategy = "manual"
)

type Plan

type Plan struct {
	SchemaVersion string       `json:"schema_version"`
	RepoRoot      string       `json:"repo_root"`
	Source        string       `json:"source"`
	GeneratedAt   time.Time    `json:"generated_at"`
	Scripts       []ScriptPlan `json:"scripts"`
	Summary       PlanSummary  `json:"summary"`
}

func BuildPlan

func BuildPlan(scan ScanResult) Plan

type PlanSummary

type PlanSummary struct {
	Total   int `json:"total"`
	Auto    int `json:"auto"`
	Wrapper int `json:"wrapper"`
	Manual  int `json:"manual"`
}

type Report

type Report struct {
	SchemaVersion string       `json:"schema_version"`
	RepoRoot      string       `json:"repo_root"`
	Source        string       `json:"source"`
	Summary       PlanSummary  `json:"summary"`
	Scripts       []ScriptPlan `json:"scripts"`
}

type ScanResult

type ScanResult struct {
	RepoRoot string       `json:"repo_root"`
	Source   string       `json:"source"`
	Scanned  int          `json:"scanned"`
	Scripts  []ScriptInfo `json:"scripts"`
}

func ScanScripts

func ScanScripts(repoRoot, source string) (ScanResult, error)

type ScriptInfo

type ScriptInfo struct {
	Name         string    `json:"name"`
	Path         string    `json:"path"`
	Shell        ShellType `json:"shell"`
	Executable   bool      `json:"executable"`
	UsesArgs     bool      `json:"uses_args"`
	UsesEnv      bool      `json:"uses_env"`
	ExternalDeps []string  `json:"external_deps,omitempty"`
	RiskSignals  []string  `json:"risk_signals,omitempty"`
	SizeBytes    int       `json:"size_bytes"`
}

type ScriptPlan

type ScriptPlan struct {
	Script   ScriptInfo        `json:"script"`
	Strategy MigrationStrategy `json:"strategy"`
	Reasons  []string          `json:"reasons,omitempty"`
	Score    float64           `json:"score"`
}

type ShellType

type ShellType string
const (
	ShellUnknown ShellType = "unknown"
	ShellSh      ShellType = "sh"
	ShellBash    ShellType = "bash"
)

Jump to

Keyboard shortcuts

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