21 lines
357 B
Go
21 lines
357 B
Go
|
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
|
||
|
}
|