Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Exist Is config file exist Exist bool // Models configs Models []ModelConfig // backup base dir VtsBackupDir string = getBackupDir() PidFilePath string = filepath.Join(VtsBackupDir, "vtsbackup.pid") LogFilePath string = filepath.Join(VtsBackupDir, "vtsbackup.log") Web WebConfig // The config file loaded at UpdatedAt time.Time )
Functions ¶
func Init ¶
Init loadConfig from: - ./vtsbackup.yml - ~/.vtsbackup/vtsbackup.yml - /etc/vtsbackup/vtsbackup.yml
func OnConfigChange ¶
OnConfigChange add callback when config changed
Types ¶
type ModelConfig ¶
type ModelConfig struct { Name string Description string // WorkDir of the backup started WorkDir string TempPath string DumpPath string Schedule ScheduleConfig CompressWith SubConfig EncryptWith SubConfig Archive *viper.Viper Splitter *viper.Viper Storages map[string]SubConfig Notifiers map[string]SubConfig DefaultStorage string Viper *viper.Viper BeforeScript string AfterScript string }
ModelConfig for special case
func GetModelConfigByName ¶
func GetModelConfigByName(name string) (model *ModelConfig)
GetModelConfigByName get model config by name
type ScheduleConfig ¶
type ScheduleConfig struct { Enabled bool `json:"enabled,omitempty"` // Cron expression Cron string `json:"cron,omitempty"` // Every Every string `json:"every,omitempty"` // At time At string `json:"at,omitempty"` }
func (ScheduleConfig) String ¶
func (sc ScheduleConfig) String() string
Click to show internal directories.
Click to hide internal directories.