Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CopyFile ¶
CopyFile copies a single file from src to dst Code taken from https://blog.depado.eu/post/copy-files-and-directories-in-go
Types ¶
type Item ¶
type Item struct { ID string `json:"id"` Hash string `json:"hash"` DateRun time.Time `json:"date_run"` Duration time.Duration `json:"duration,string"` }
Item holds migration item info
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository holds DB info
func NewMigrationRepository ¶
func NewMigrationRepository(path string) (*Repository, error)
NewMigrationRepository takes a path and creates a DB repository
func (*Repository) CreateMigration ¶
func (repo *Repository) CreateMigration(migrationItem *Item) error
CreateMigration stores a migration item in DB
func (*Repository) Exists ¶
func (repo *Repository) Exists(id string) bool
Exists checks that migrationID has been ran
func (*Repository) GetMigrationByID ¶
func (repo *Repository) GetMigrationByID(id string) (*Item, error)
GetMigrationByID returns migration ID if it exists
func (*Repository) Open ¶
func (repo *Repository) Open() (err error)
Open opens a DB, requires it to be closed before or it will error out
type Runner ¶
type Runner struct{}
Runner is the actor that runs the migrations
func NewMigrationRunner ¶
func NewMigrationRunner() *Runner
NewMigrationRunner creates default runner
func (*Runner) RunMigrations ¶
RunMigrations executes the migrations
Click to show internal directories.
Click to hide internal directories.