docker-db-backup/dump.go

21 lines
357 B
Go
Raw Normal View History

2021-08-18 18:25:59 +00:00
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
}