3
0
mirror of https://kolaente.dev/konrad/docker-db-backup.git synced 2026-01-10 02:50:08 +01:00

Add dumpers

This commit is contained in:
kolaente
2021-08-18 20:25:59 +02:00
parent d3abd6749f
commit 79f6c5cfad
4 changed files with 63 additions and 5 deletions

20
dump.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import "github.com/docker/docker/api/types"
type Dumper interface {
Dump() error
}
func NewDumperFromContainer(container *types.ContainerJSON) Dumper {
switch container.Config.Image {
case "mysql":
fallthrough
case "mariadb":
return NewMysqlDumper(container)
case "postgres":
return NewPostgresDumper(container)
}
return nil
}