config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BackupConfig

type BackupConfig struct {
	Directory           string        `mapstructure:"directory"`
	Databases           []string      `mapstructure:"databases"`
	BatchSize           int           `mapstructure:"batch_size"`
	Concurrency         int           `mapstructure:"concurrency"`
	Timeout             time.Duration `mapstructure:"timeout"`
	RetryCount          int           `mapstructure:"retry_count"`
	RetryDelay          time.Duration `mapstructure:"retry_delay"`
	CheckLastBackupTime bool          `mapstructure:"check_last_backup_time"`
	MinBackupInterval   time.Duration `mapstructure:"min_backup_interval"`
	SkipConfirmation    bool          `mapstructure:"skip_confirmation"`
}

type CleanupConfig

type CleanupConfig struct {
	Enabled              bool     `mapstructure:"enabled"`
	CleanupUploadedFiles bool     `mapstructure:"cleanup_uploaded_files"`
	RemoteRetention      int      `mapstructure:"remote_retention_days"`
	WeekendOnly          bool     `mapstructure:"weekend_only"`
	AgeBasedCleanup      bool     `mapstructure:"age_based_cleanup"`
	MaxAgeDays           int      `mapstructure:"max_age_days"`
	VerifyCloudExists    bool     `mapstructure:"verify_cloud_exists"`
	Databases            []string `mapstructure:"databases"`
}

type Config

type Config struct {
	Database DatabaseConfig `mapstructure:"database"`
	Backup   BackupConfig   `mapstructure:"backup"`
	Upload   UploadConfig   `mapstructure:"upload"`
	Logging  LoggingConfig  `mapstructure:"logging"`
	Cleanup  CleanupConfig  `mapstructure:"cleanup"`
	Metrics  MetricsConfig  `mapstructure:"metrics"`
}

func LoadConfig

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

type DatabaseConfig

type DatabaseConfig struct {
	Host     string          `mapstructure:"host"`
	Port     int             `mapstructure:"port"`
	Username string          `mapstructure:"username"`
	Password string          `mapstructure:"password"`
	Timeout  int             `mapstructure:"timeout"`
	Mydumper *MydumperConfig `mapstructure:"mydumper"`
}

type LoggingConfig

type LoggingConfig struct {
	Level      string `mapstructure:"level"`
	Format     string `mapstructure:"format"`
	FileFormat string `mapstructure:"file_format"`
	FilePath   string `mapstructure:"file_path"`
}

type MetricsConfig

type MetricsConfig struct {
	Enabled     bool   `mapstructure:"enabled"`
	Port        string `mapstructure:"port"`
	StoragePath string `mapstructure:"storage_path"`
}

type MydumperConfig

type MydumperConfig struct {
	Enabled         bool            `mapstructure:"enabled"`
	BinaryPath      string          `mapstructure:"binary_path"`
	DefaultsFile    string          `mapstructure:"defaults_file"`
	Threads         int             `mapstructure:"threads"`
	ChunkFilesize   int             `mapstructure:"chunk_filesize"`
	CompressMethod  string          `mapstructure:"compress_method"`
	BuildEmptyFiles bool            `mapstructure:"build_empty_files"`
	UseDefer        bool            `mapstructure:"use_defer"`
	SingleTable     bool            `mapstructure:"single_table"`
	NoSchemas       bool            `mapstructure:"no_schemas"`
	NoData          bool            `mapstructure:"no_data"`
	Myloader        *MyloaderConfig `mapstructure:"myloader"`
}

type MyloaderConfig

type MyloaderConfig struct {
	Enabled      bool   `mapstructure:"enabled"`
	BinaryPath   string `mapstructure:"binary_path"`
	DefaultsFile string `mapstructure:"defaults_file"`
	Threads      int    `mapstructure:"threads"`
}

type UploadConfig

type UploadConfig struct {
	Enabled          bool   `mapstructure:"enabled"`
	RclonePath       string `mapstructure:"rclone_path"`
	RcloneConfigPath string `mapstructure:"rclone_config_path"`
	Destination      string `mapstructure:"destination"`
	Timeout          int    `mapstructure:"timeout"`
	RetryCount       int    `mapstructure:"retry_count"`
}

Jump to

Keyboard shortcuts

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