Updated Config struct
This commit is contained in:
parent
10addaf4ca
commit
39ab159500
1 changed files with 21 additions and 5 deletions
26
Config.go
26
Config.go
|
|
@ -7,11 +7,27 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
_7zPath string
|
LocalBackupPath string `json:"localBackupPath"`
|
||||||
_7zArgs string
|
SQLConfig struct{
|
||||||
|
SqlType string `json:"sqlType"`
|
||||||
|
SqlAddress string `json:"sql-address"`
|
||||||
|
SqlPort uint16 `json:"sql-port"`
|
||||||
|
Database string `json:"database"`
|
||||||
|
DbUser string `json:"db-user"`
|
||||||
|
DbPassword string `json:"db-password"`
|
||||||
|
} `json:"sqlConfig"`
|
||||||
|
FolderToBackup []struct{
|
||||||
|
BackupName string `json:"backupName"`
|
||||||
|
FolderPath string `json:"folderPath"`
|
||||||
|
StorageType string `json:"storageType"`
|
||||||
|
CreateLocalBackup bool `json:"createLocalBackup"`
|
||||||
|
} `json:"foldersToBackup"`
|
||||||
|
}
|
||||||
|
type Backup struct{
|
||||||
|
backupName string
|
||||||
|
folderPath string
|
||||||
storageType string
|
storageType string
|
||||||
localbackup uint8
|
createLocalBackup bool
|
||||||
localbackupPath string
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func readConfig() []byte {
|
func readConfig() []byte {
|
||||||
|
|
@ -21,10 +37,10 @@ func readConfig() []byte {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logger.Fatal(err)
|
logger.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return file
|
return file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func GetConfig() Config {
|
func GetConfig() Config {
|
||||||
logger := Logging.DetailedLogger("ConfigHandler", "GetConfig()")
|
logger := Logging.DetailedLogger("ConfigHandler", "GetConfig()")
|
||||||
var config Config
|
var config Config
|
||||||
|
|
|
||||||
Reference in a new issue