migrator

package
v0.15.17-hotfix.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MigrationTaskFn

type MigrationTaskFn func(result fs.ReadInfoFileResult) (migration.NewTaskFn, bool)

MigrationTaskFn returns a fileset migration function and a boolean indicating if migration is necessary.

type Migrator

type Migrator struct {
	// contains filtered or unexported fields
}

Migrator is responsible for migrating data filesets based on version information in the info files.

func NewMigrator

func NewMigrator(opts Options) (Migrator, error)

NewMigrator creates a new Migrator.

func (*Migrator) Run

func (m *Migrator) Run(ctx context.Context) error

Run runs the migrator.

type Options

type Options interface {
	// Validate checks that options are valid.
	Validate() error

	// SetMigrationTaskFn sets the function for determining if the migrator should migrate a fileset.
	SetMigrationTaskFn(value MigrationTaskFn) Options

	// MigrationTaskFn gets the function for determining if the migrator should migrate a fileset.
	MigrationTaskFn() MigrationTaskFn

	// SetInfoFilesByNamespaces sets the info file results to operate on keyed by namespace.
	SetInfoFilesByNamespace(value bootstrap.InfoFilesByNamespace) Options

	// InfoFilesByNamespaces returns the info file results to operate on keyed by namespace.
	InfoFilesByNamespace() bootstrap.InfoFilesByNamespace

	// SetMigrationOptions sets the migration options.
	SetMigrationOptions(value migration.Options) Options

	// MigrationOptions returns the migration options.
	MigrationOptions() migration.Options

	// SetFilesystemOptions sets the filesystem options.
	SetFilesystemOptions(value fs.Options) Options

	// FileSystemOptions returns the filesystem options.
	FilesystemOptions() fs.Options

	// SetInstrumentOptions sets the instrument options.
	SetInstrumentOptions(value instrument.Options) Options

	// InstrumentOptions returns the instrument options.
	InstrumentOptions() instrument.Options

	// SetStorageOptions sets the storage options.
	SetStorageOptions(value storage.Options) Options

	// StorageOptions returns the storage options.
	StorageOptions() storage.Options
}

Options represents the options for the migrator.

func NewOptions

func NewOptions() Options

NewOptions return new migration opts

Jump to

Keyboard shortcuts

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