migration

package
v0.15.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateMigrationVersion

func ValidateMigrationVersion(m MigrationVersion) error

ValidateMigrationVersion validates a stored metrics type.

Types

type MigrationVersion

type MigrationVersion uint

MigrationVersion is an enum that corresponds to the major and minor version number to migrate data files to.

const (
	// MigrationVersionNone indicates node should not attempt to perform any migrations.
	MigrationVersionNone MigrationVersion = iota
	// MigrationVersion_1_1 indicates node should attempt to migrate data files up to version 1.1.
	MigrationVersion_1_1
)

func ParseMigrationVersion

func ParseMigrationVersion(str string) (MigrationVersion, error)

ParseMigrationVersion parses a string for a MigrationVersion.

func (*MigrationVersion) String

func (m *MigrationVersion) String() string

func (*MigrationVersion) UnmarshalYAML

func (m *MigrationVersion) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML unmarshals a migrate version.

type Options

type Options interface {
	// Validate validates migration options.
	Validate() error

	// SetTargetMigrationVersion sets the target version for a migration
	SetTargetMigrationVersion(value MigrationVersion) Options

	// TargetMigrationVersion is the target version for a migration.
	TargetMigrationVersion() MigrationVersion

	// SetConcurrency sets the number of concurrent workers performing migrations.
	SetConcurrency(value int) Options

	// Concurrency gets the number of concurrent workers performing migrations.
	Concurrency() int
}

Options represents the options for migrations.

func NewOptions

func NewOptions() Options

NewOptions creates new migration options.

Jump to

Keyboard shortcuts

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