runner

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: Apache-2.0, MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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

Jump to

Keyboard shortcuts

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