config

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackupDir

func GetBackupDir(backupDir string) string

func GetConfigFile

func GetConfigFile(cfgFile string) string

func GetDefaultConfigDir added in v0.21.0

func GetDefaultConfigDir() string

func SaveConfig

func SaveConfig(config Config, cfgFile string) error

func SetSensibleDefaults added in v0.16.0

func SetSensibleDefaults(cfg *Config)

func ValidateConfig added in v0.4.1

func ValidateConfig(cfg Config) error

Types

type Config

type Config struct {
	Username      string             `mapstructure:"username"`
	Token         string             `mapstructure:"token"`  // Deprecated: Use Tokens instead
	Tokens        []string           `mapstructure:"tokens"` // New field for multiple tokens
	Platform      string             `mapstructure:"platform"`
	Server        Server             `mapstructure:"server"`
	IncludeRepos  []string           `mapstructure:"include_repos"`
	ExcludeRepos  []string           `mapstructure:"exclude_repos"`
	IncludeOrgs   []string           `mapstructure:"include_orgs"`
	ExcludeOrgs   []string           `mapstructure:"exclude_orgs"`
	IncludeForks  bool               `mapstructure:"include_forks"`
	IncludeWiki   bool               `mapstructure:"include_wiki"`
	IncludeIssues bool               `mapstructure:"include_issues"`
	BackupDir     string             `mapstructure:"backup_dir"`
	Workspace     string             `mapstructure:"workspace"`
	Cron          string             `mapstructure:"cron"`
	CloneType     string             `mapstructure:"clone_type"`
	RawGitURLs    []string           `mapstructure:"raw_git_urls"`
	Concurrency   int                `mapstructure:"concurrency"`
	Retry         RetryConfig        `mapstructure:"retry"`
	Notification  NotificationConfig `mapstructure:"notification"`
	Telemetry     TelemetryConfig    `mapstructure:"telemetry"`
}

func GetInitialConfig added in v0.11.1

func GetInitialConfig() Config

func LoadConfig

func LoadConfig(cfgFile string) (Config, error)

type GotifyConfig added in v0.18.0

type GotifyConfig struct {
	URL      string `mapstructure:"url"`
	AppToken string `mapstructure:"app_token"`
	Priority int    `mapstructure:"priority"`
}

type InvalidConfigError added in v0.17.0

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

func NewInvalidConfigError added in v0.17.0

func NewInvalidConfigError(message string) *InvalidConfigError

func (*InvalidConfigError) Error added in v0.17.0

func (e *InvalidConfigError) Error() string

type NotificationConfig added in v0.18.0

type NotificationConfig struct {
	Enabled      bool          `mapstructure:"enabled"`
	OnlyFailures bool          `mapstructure:"only_failures"`
	Ntfy         *NtfyConfig   `mapstructure:"ntfy"`
	Gotify       *GotifyConfig `mapstructure:"gotify"`
}

type NtfyConfig added in v0.18.0

type NtfyConfig struct {
	Topic    string   `mapstructure:"topic"`
	Server   string   `mapstructure:"server"`   // Optional, defaults to ntfy.sh
	Priority int      `mapstructure:"priority"` // Optional, 1-5 (min-max), defaults to 3
	Username string   `mapstructure:"username"` // Optional, for authentication
	Password string   `mapstructure:"password"` // Optional, for authentication
	Tags     []string `mapstructure:"tags"`     // Optional, git-sync tag is always included
}

type RetryConfig added in v0.15.0

type RetryConfig struct {
	Count int `mapstructure:"count"`
	Delay int `mapstructure:"delay"` // in seconds
}

type Server added in v0.4.0

type Server struct {
	Domain   string `mapstructure:"domain"`
	Protocol string `mapstructure:"protocol"`
}

type TelemetryConfig added in v0.21.0

type TelemetryConfig struct {
	Enabled bool `mapstructure:"enabled"`
}

Jump to

Keyboard shortcuts

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