Version: v0.1.0 Latest Latest

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

Go to latest
Published: Sep 30, 2020 License: Apache-2.0, MIT Imports: 6 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type RunMigrationsFunc

type RunMigrationsFunc func(ctx context.Context, ds datastore.Batching, migrations versioning.VersionedMigrationList, target versioning.VersionKey) (versioning.VersionKey, error)

RunMigrationsFunc is a function that runs migrations

type Runner

type Runner struct {
	// contains filtered or unexported fields

Runner executes a migrations exactly once and can queried for status of that migration and any migration errors

func NewRunner

func NewRunner(ds datastore.Batching, migrations versioning.VersionedMigrationList, target versioning.VersionKey, runMigrations RunMigrationsFunc) *Runner

NewRunner returns a new runner instance for the given datastore, migrations, and target

func (*Runner) Migrate

func (m *Runner) Migrate(ctx context.Context) error

Migrate executes the migration, if it has not already been executed

func (*Runner) ReadyError

func (m *Runner) ReadyError() error

ReadyError returns the ready state of the migration - either nil for ready or err for not ready or a migration error

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to