config

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: 4 Imported by: 0

Documentation

Overview

Package config parses the optional batch YAML configuration and merges it with built-in defaults into a fully-resolved migration plan.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Target   Target  `yaml:"target"`
	Run      Run     `yaml:"run"`
	Defaults Options `yaml:"defaults"`
	Jobs     []Job   `yaml:"jobs"`
}

File is the top-level YAML document.

func Load

func Load(path string) (*File, error)

Load reads and parses a YAML config file.

type Job

type Job struct {
	Source      SourceSpec `yaml:"source"`
	TargetOwner string     `yaml:"target_owner"`
	Options     Options    `yaml:",inline"`
}

Job is one migration unit: a source plus per-job option overrides.

type Options

type Options struct {
	Issues         *bool   `yaml:"issues"`
	PullRequests   *bool   `yaml:"pull_requests"`
	Labels         *bool   `yaml:"labels"`
	Milestones     *bool   `yaml:"milestones"`
	Releases       *bool   `yaml:"releases"`
	Wiki           *bool   `yaml:"wiki"`
	LFS            *bool   `yaml:"lfs"`
	Mirror         *bool   `yaml:"mirror"`
	Private        *bool   `yaml:"private"`
	MirrorInterval *string `yaml:"mirror_interval"`
}

Options are tri-state migration toggles; a nil pointer means "inherit".

func DefaultOptions

func DefaultOptions() Options

DefaultOptions is the built-in baseline: content toggles on, LFS/mirror/ private off.

func Merge

func Merge(base, over Options) Options

Merge overlays over onto base, keeping base values where over is nil.

func (Options) Forgejo

func (o Options) Forgejo() forgejo.Options

Forgejo converts a fully-resolved option set into the target-client type. Merge onto DefaultOptions first so no pointer is nil.

type Run

type Run struct {
	Concurrency  *int  `yaml:"concurrency"`
	RateLimit    *int  `yaml:"rate_limit"`
	SkipExisting *bool `yaml:"skip_existing"`
}

Run holds run-level settings shared by every job.

type SourceSpec

type SourceSpec struct {
	Type  string   `yaml:"type"`
	URL   string   `yaml:"url"`
	Token string   `yaml:"token"`
	Org   string   `yaml:"org"`
	User  string   `yaml:"user"`
	Repos []string `yaml:"repos"`
}

SourceSpec identifies where repositories are read from.

type Target

type Target struct {
	URL       string `yaml:"url"`
	Owner     string `yaml:"owner"`
	Token     string `yaml:"token"`
	CreateOrg bool   `yaml:"create_org"`
}

Target describes the destination Forgejo instance and owner.

Jump to

Keyboard shortcuts

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