migrate

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package migrate resolves a migration plan into concrete repository migrations and executes them against the target Forgejo instance with a bounded worker pool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job struct {
	Source      SourceSpec
	TargetOwner string
	Options     forgejo.Options
}

Job pairs a source with resolved options and an optional target-owner override.

type Plan

type Plan struct {
	Target   Target
	Settings Settings
	Jobs     []Job
}

Plan is the fully-resolved unit of work handed to the runner.

type Result

type Result struct {
	Migrated int
	Skipped  int
	Failed   int
}

Result summarizes a run.

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

Runner executes migration plans.

func NewRunner

func NewRunner(log zerolog.Logger) *Runner

NewRunner builds a Runner.

func (*Runner) Run

func (r *Runner) Run(ctx context.Context, plan Plan) (Result, error)

Run resolves every job's repositories and migrates them. It returns a summary; per-repository failures are logged and counted rather than aborting the whole run.

type Settings

type Settings struct {
	Concurrency  int
	RateLimit    int
	SkipExisting bool
	DryRun       bool
}

Settings are resolved run-level controls.

type SourceSpec

type SourceSpec struct {
	Kind  source.Kind
	URL   string
	Token string
	Org   string
	User  string
	Repos []string
}

SourceSpec is a resolved source description for a single job.

type Target

type Target struct {
	URL       string
	Owner     string
	Token     string
	CreateOrg bool
}

Target is the resolved destination instance and default owner.

Jump to

Keyboard shortcuts

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