migrate/driver/bash/bash.go
Philippe Lafoucrière 9754378aa5 Move the registry to driver package
We can't test driver.New methods because of circular imports.
That's probably why the initial code had a map[string]interface{} as
registry: it removes a dependency import.
I prefer the remove the registry and have a registry returning a real
Driver. It will ease the development later.
2015-10-22 16:29:26 -04:00

37 lines
600 B
Go

// Package bash implements the Driver interface.
package bash
import (
"github.com/mattes/migrate/driver"
"github.com/mattes/migrate/file"
)
type Driver struct {
}
func (driver *Driver) Initialize(url string) error {
return nil
}
func (driver *Driver) Close() error {
return nil
}
func (driver *Driver) FilenameExtension() string {
return "sh"
}
func (driver *Driver) Migrate(f file.File, pipe chan interface{}) {
defer close(pipe)
pipe <- f
return
}
func (driver *Driver) Version() (uint64, error) {
return uint64(0), nil
}
func init() {
driver.RegisterDriver("bash", &Driver{})
}