config

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultDaemonError = 300
View Source
const DefaultDestMirrorInterval = "8h0m0s"
View Source
const GiteaURL = "https://gitea.com"
View Source
const MinimumDaemon = 60

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ShowVersion bool
	ShowInfo    bool

	Daemon          int  `env:"DAEMON"`
	DaemonError     int  `env:"DAEMON_ERROR"`
	DaemonSkipFirst bool `env:"DAEMON_SKIP_FIRST"`
	DaemonExitError bool `env:"DAEMON_EXIT_ERROR"`

	Source      Source
	GitHubOwner string   `env:"GITHUB_OWNER"`
	GitHubToken string   `env:"GITHUB_TOKEN"`
	GiteaOwner  string   `env:"GITEA_OWNER"`
	GiteaToken  string   `env:"GITEA_TOKEN"`
	GiteaURL    string   `env:"GITEA_URL"`
	SkipRepos   []string `env:"SKIP_REPOS" envSeparator:" "`
	SkipForks   bool     `env:"SKIP_FORKS"`
	SkipPrivate bool     `env:"SKIP_PRIVATE"`

	MigrateWiki bool `env:"MIGRATE_WIKI"`
	MigrateLFS  bool `env:"MIGRATE_LFS"`

	SyncAll            bool `env:"SYNC_ALL"`
	SyncTopics         bool `env:"SYNC_TOPICS"`
	SyncDescription    bool `env:"SYNC_DESCRIPTION"`
	SyncVisibility     bool `env:"SYNC_VISIBILITY"`
	SyncMirrorInterval bool `env:"SYNC_MIRROR_INTERVAL"`

	DestURL            string `env:"DEST_URL"`
	DestToken          string `env:"DEST_TOKEN"`
	DestOwner          string `env:"DEST_OWNER"`
	DestMirrorInterval string `env:"DEST_MIRROR_INTERVAL"`
}

func New

func New() *Config

func (*Config) ParseAndValidate

func (cfg *Config) ParseAndValidate() error

type Source

type Source string
const (
	SourceGitHub Source = "github"
	SourceGitea  Source = "gitea"
)

Jump to

Keyboard shortcuts

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