config

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package config provides configuration loading for forge provider credentials and sync settings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	GitHub GitHubConfig `yaml:"github"` //nolint:tagliatelle // "github" is the canonical platform name used in config files
	GitLab GitLabConfig `yaml:"gitlab"` //nolint:tagliatelle // "gitlab" is the canonical platform name used in config files
	Gitea  GiteaConfig  `yaml:"gitea"`
	Sync   SyncConfig   `yaml:"sync"`
}

Config represents the application configuration.

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a config with default values.

func Load

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

Load loads configuration from file.

func LoadDefault

func LoadDefault() (*Config, error)

LoadDefault loads configuration from default locations.

type GitHubConfig

type GitHubConfig struct {
	Token   string `yaml:"token"`
	BaseURL string `yaml:"base_url"` //nolint:tagliatelle // snake_case is the established config file convention; changing would break existing configs
}

GitHubConfig holds GitHub-specific configuration.

type GitLabConfig

type GitLabConfig struct {
	Token   string `yaml:"token"`
	BaseURL string `yaml:"base_url"` //nolint:tagliatelle // snake_case is the established config file convention; changing would break existing configs
}

GitLabConfig holds GitLab-specific configuration.

type GiteaConfig

type GiteaConfig struct {
	Token   string `yaml:"token"`
	BaseURL string `yaml:"base_url"` //nolint:tagliatelle // snake_case is the established config file convention; changing would break existing configs
}

GiteaConfig holds Gitea-specific configuration.

type SyncConfig

type SyncConfig struct {
	TargetPath      string `yaml:"target_path"` //nolint:tagliatelle // snake_case is the established config file convention
	Parallel        int    `yaml:"parallel"`
	IncludeArchived bool   `yaml:"include_archived"` //nolint:tagliatelle // snake_case is the established config file convention
	IncludeForks    bool   `yaml:"include_forks"`    //nolint:tagliatelle // snake_case is the established config file convention
	IncludePrivate  bool   `yaml:"include_private"`  //nolint:tagliatelle // snake_case is the established config file convention
}

SyncConfig holds sync operation defaults.

Jump to

Keyboard shortcuts

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