mirror of
https://kolaente.dev/konrad/docker-db-backup.git
synced 2026-01-10 02:50:08 +01:00
feat: add completion webhook url
This commit is contained in:
13
config.go
13
config.go
@@ -17,6 +17,7 @@ type conf struct {
|
||||
fullCurrentBackupPath string
|
||||
Schedule string
|
||||
MaxBackups int
|
||||
CompletionWebhookURL string
|
||||
}
|
||||
|
||||
var (
|
||||
@@ -25,9 +26,10 @@ var (
|
||||
)
|
||||
|
||||
const (
|
||||
envBackupFolder = `BACKUP_FOLDER`
|
||||
envSchedule = `BACKUP_SCHEDULE`
|
||||
envMax = `BACKUP_MAX`
|
||||
envBackupFolder = `BACKUP_FOLDER`
|
||||
envSchedule = `BACKUP_SCHEDULE`
|
||||
envMax = `BACKUP_MAX`
|
||||
envCompletionWebhookURL = `BACKUP_COMPLETION_WEBHOOK_URL`
|
||||
)
|
||||
|
||||
func init() {
|
||||
@@ -60,6 +62,11 @@ func init() {
|
||||
config.MaxBackups = int(maxBackups)
|
||||
}
|
||||
|
||||
webhookURL, has := os.LookupEnv(envCompletionWebhookURL)
|
||||
if has {
|
||||
config.CompletionWebhookURL = webhookURL
|
||||
}
|
||||
|
||||
updateFullBackupPath()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user