Updated Config struct

This commit is contained in:
netbenix 2021-11-19 19:36:18 +01:00
parent 10addaf4ca
commit 39ab159500

View file

@ -7,11 +7,27 @@ import (
)
type Config struct {
_7zPath string
_7zArgs string
LocalBackupPath string `json:"localBackupPath"`
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
localbackup uint8
localbackupPath string
createLocalBackup bool
}
func readConfig() []byte {
@ -21,10 +37,10 @@ func readConfig() []byte {
if err != nil {
logger.Fatal(err)
}
return file
}
func GetConfig() Config {
logger := Logging.DetailedLogger("ConfigHandler", "GetConfig()")
var config Config