config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ForgeGitlab = "gitlab"
	ForgeGithub = "github"
	ForgeGitea  = "gitea"

	PullMethodHTTP = "http"
	PullMethodSSH  = "ssh"

	ArchivedProjectShow   = "show"
	ArchivedProjectHide   = "hide"
	ArchivedProjectIgnore = "ignore"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	FS     FSConfig           `yaml:"fs,omitempty"`
	Gitlab GitlabClientConfig `yaml:"gitlab,omitempty"`
	Github GithubClientConfig `yaml:"github,omitempty"`
	Gitea  GiteaClientConfig  `yaml:"gitea,omitempty"`
	Git    GitClientConfig    `yaml:"git,omitempty"`
}

func LoadConfig

func LoadConfig(configPath string) (*Config, error)

type FSConfig

type FSConfig struct {
	Mountpoint   string `yaml:"mountpoint,omitempty"`
	MountOptions string `yaml:"mountoptions,omitempty"`
	Forge        string `yaml:"forge,omitempty"`
}

type GitClientConfig

type GitClientConfig struct {
	CloneLocation    string `yaml:"clone_location,omitempty"`
	Remote           string `yaml:"remote,omitempty"`
	OnClone          string `yaml:"on_clone,omitempty"`
	AutoPull         bool   `yaml:"auto_pull,omitempty"`
	Depth            int    `yaml:"depth,omitempty"`
	QueueSize        int    `yaml:"queue_size,omitempty"`
	QueueWorkerCount int    `yaml:"worker_count,omitempty"`
}

func MakeGitConfig

func MakeGitConfig(config *Config) (*GitClientConfig, error)

type GiteaClientConfig

type GiteaClientConfig struct {
	URL   string `yaml:"url,omitempty"`
	Token string `yaml:"token,omitempty"`

	OrgNames  []string `yaml:"org_names,omitempty"`
	UserNames []string `yaml:"user_names,omitempty"`

	ArchivedRepoHandling string `yaml:"archived_repo_handling,omitempty"`
	IncludeCurrentUser   bool   `yaml:"include_current_user,omitempty"`
	PullMethod           string `yaml:"pull_method,omitempty"`
}

func MakeGiteaConfig

func MakeGiteaConfig(config *Config) (*GiteaClientConfig, error)

type GithubClientConfig

type GithubClientConfig struct {
	Token string `yaml:"token,omitempty"`

	OrgNames  []string `yaml:"org_names,omitempty"`
	UserNames []string `yaml:"user_names,omitempty"`

	ArchivedRepoHandling string `yaml:"archived_repo_handling,omitempty"`
	IncludeCurrentUser   bool   `yaml:"include_current_user,omitempty"`
	PullMethod           string `yaml:"pull_method,omitempty"`
}

func MakeGithubConfig

func MakeGithubConfig(config *Config) (*GithubClientConfig, error)

type GitlabClientConfig

type GitlabClientConfig struct {
	URL   string `yaml:"url,omitempty"`
	Token string `yaml:"token,omitempty"`

	GroupIDs  []int    `yaml:"group_ids,omitempty"`
	UserNames []string `yaml:"user_names,omitempty"`

	ArchivedProjectHandling string `yaml:"archived_project_handling,omitempty"`
	IncludeCurrentUser      bool   `yaml:"include_current_user,omitempty"`
	PullMethod              string `yaml:"pull_method,omitempty"`
}

func MakeGitlabConfig

func MakeGitlabConfig(config *Config) (*GitlabClientConfig, error)

Jump to

Keyboard shortcuts

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