Documentation ¶
Index ¶
- Variables
- func Register(name string, driver Driver)
- type Direction
- type Driver
- type Migration
- type Migrations
- func (i *Migrations) Append(m *Migration) (ok bool)
- func (i *Migrations) Down(version uint) (m *Migration, ok bool)
- func (i *Migrations) First() (version uint, ok bool)
- func (i *Migrations) Next(version uint) (nextVersion uint, ok bool)
- func (i *Migrations) Prev(version uint) (prevVersion uint, ok bool)
- func (i *Migrations) Up(version uint) (m *Migration, ok bool)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultParse = Parse
View Source
var DefaultRegex = Regex
View Source
var ErrParse = fmt.Errorf("no match")
View Source
var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`)
filename example: `123_name.up.ext` filename example: `123_name.down.ext`
Functions ¶
Types ¶
type Driver ¶
type Driver interface { Open(url string) (Driver, error) Close() error First() (version uint, err error) Prev(version uint) (prevVersion uint, err error) Next(version uint) (nextVersion uint, err error) ReadUp(version uint) (r io.ReadCloser, identifier string, err error) ReadDown(version uint) (r io.ReadCloser, identifier string, err error) }
type Migrations ¶
type Migrations struct {
// contains filtered or unexported fields
}
func NewMigrations ¶
func NewMigrations() *Migrations
func (*Migrations) Append ¶
func (i *Migrations) Append(m *Migration) (ok bool)
func (*Migrations) First ¶
func (i *Migrations) First() (version uint, ok bool)
Click to show internal directories.
Click to hide internal directories.