refactor(Config): Removed unused property
This commit is contained in:
parent
d2f47ad604
commit
2fb37a9953
1 changed files with 14 additions and 15 deletions
|
|
@ -7,21 +7,20 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
LocalBackupPath string `json:"localBackupPath"`
|
SQLConfig struct {
|
||||||
SQLConfig struct{
|
EnableSQL bool `json:"enableSQL"`
|
||||||
EnableSQL bool `json:"enableSQL"`
|
SqlType string `json:"sqlType"`
|
||||||
SqlType string `json:"sqlType"`
|
|
||||||
SqlAddress string `json:"sql-address"`
|
SqlAddress string `json:"sql-address"`
|
||||||
SqlPort uint16 `json:"sql-port"`
|
SqlPort uint16 `json:"sql-port"`
|
||||||
Database string `json:"database"`
|
Database string `json:"database"`
|
||||||
DbUser string `json:"db-user"`
|
DbUser string `json:"db-user"`
|
||||||
DbPassword string `json:"db-password"`
|
DbPassword string `json:"db-password"`
|
||||||
} `json:"sqlConfig"`
|
} `json:"sqlConfig"`
|
||||||
FolderToBackup []struct{
|
FolderToBackup []struct {
|
||||||
BackupName string `json:"backupName"`
|
BackupName string `json:"backupName"`
|
||||||
FolderPath string `json:"folderPath"`
|
FolderPath string `json:"folderPath"`
|
||||||
RemoteStorageType string `json:"remoteStorageType"`
|
RemoteStorageType string `json:"remoteStorageType"`
|
||||||
RemoteTargetPath string `json:"remoteTargetPath"`
|
RemoteTargetPath string `json:"remoteTargetPath"`
|
||||||
CreateLocalBackup bool `json:"createLocalBackup"`
|
CreateLocalBackup bool `json:"createLocalBackup"`
|
||||||
LocalTargetPath string `json:"LocalTargetPath"`
|
LocalTargetPath string `json:"LocalTargetPath"`
|
||||||
} `json:"foldersToBackup"`
|
} `json:"foldersToBackup"`
|
||||||
|
|
@ -37,12 +36,12 @@ func readConfig() []byte {
|
||||||
return file
|
return file
|
||||||
}
|
}
|
||||||
|
|
||||||
func CheckIfConfigExists(){
|
func CheckIfConfigExists() {
|
||||||
logger := Logging.DetailedLogger("ConfigHandler", "CheckIfConfigExists")
|
logger := Logging.DetailedLogger("ConfigHandler", "CheckIfConfigExists")
|
||||||
|
|
||||||
if _, err := os.Stat("config/config.json"); os.IsNotExist(err){
|
if _, err := os.Stat("config/config.json"); os.IsNotExist(err) {
|
||||||
_, fileErr := os.OpenFile("config/config.json", os.O_CREATE, 0775)
|
_, fileErr := os.OpenFile("config/config.json", os.O_CREATE, 0775)
|
||||||
if fileErr != nil{
|
if fileErr != nil {
|
||||||
logger.Fatal(fileErr)
|
logger.Fatal(fileErr)
|
||||||
}
|
}
|
||||||
generateDefaultConfig()
|
generateDefaultConfig()
|
||||||
|
|
@ -79,4 +78,4 @@ func GetConfig() Config {
|
||||||
}
|
}
|
||||||
|
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Reference in a new issue