models

package
v0.0.0-...-f9a9926 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 7, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParse = fmt.Errorf("no match")
)
View Source
var Regex = regexp.MustCompile(`^([0-9]+)_(.*)\.(` + string(Down) + `|` + string(Up) + `)\.(.*)$`)

Regex matches the following pattern:

123_name.up.ext
123_name.down.ext

Functions

This section is empty.

Types

type Direction

type Direction string

Direction is either up or down.

const (
	Down Direction = "down"
	Up   Direction = "up"
)

type Migration

type Migration struct {
	Bytes     io.ReadCloser
	Name      string
	RawName   string
	Version   uint32
	Direction Direction
}

func NewMigration

func NewMigration(migrationBytes io.ReadCloser, fileName string) (*Migration, error)

func (*Migration) Close

func (m *Migration) Close() error

func (*Migration) Query

func (m *Migration) Query() (string, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL