From 44d9b8342646a05c7c6e045e619d2c36c1026237 Mon Sep 17 00:00:00 2001 From: Jonas Kaninda Date: Thu, 3 Oct 2024 18:05:50 +0200 Subject: [PATCH] chore: add storage type alt for smallcase and uppercase --- pkg/backup.go | 6 +++--- pkg/restore.go | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/backup.go b/pkg/backup.go index 71b2288..7d8e9b0 100644 --- a/pkg/backup.go +++ b/pkg/backup.go @@ -76,11 +76,11 @@ func BackupTask(db *dbConfig, config *BackupConfig) { switch config.storage { case "local": localBackup(db, config) - case "s3": + case "s3", "S3": s3Backup(db, config) - case "ssh", "remote": + case "ssh", "SSH", "remote": sshBackup(db, config) - case "ftp": + case "ftp", "FTP": ftpBackup(db, config) //utils.Fatal("Not supported storage type: %s", config.storage) default: diff --git a/pkg/restore.go b/pkg/restore.go index 970b527..4feb3b3 100644 --- a/pkg/restore.go +++ b/pkg/restore.go @@ -21,15 +21,15 @@ func StartRestore(cmd *cobra.Command) { restoreConf := initRestoreConfig(cmd) switch restoreConf.storage { - case "s3": - restoreFromS3(dbConf, restoreConf.file, restoreConf.bucket, restoreConf.s3Path) case "local": utils.Info("Restore database from local") copyToTmp(storagePath, restoreConf.file) RestoreDatabase(dbConf, restoreConf.file) - case "ssh": + case "s3", "S3": + restoreFromS3(dbConf, restoreConf.file, restoreConf.bucket, restoreConf.s3Path) + case "ssh", "SSH", "remote": restoreFromRemote(dbConf, restoreConf.file, restoreConf.remotePath) - case "ftp": + case "ftp", "FTP": restoreFromFTP(dbConf, restoreConf.file, restoreConf.remotePath) default: utils.Info("Restore database from local")