migrate

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustParseConstraint

func MustParseConstraint(input string) *semver.Constraints

Types

type InlineMigration

type InlineMigration struct {
	MigrationName     string
	ActivateOnVersion *semver.Constraints
	ActivateFunc      func(*semver.Version) bool
	HookFunc          func(context.Context) (*storage.Client, error)
	CleanupFunc       func(context.Context) error
}

func (*InlineMigration) Check

func (im *InlineMigration) Check(clusterVersion *semver.Version, ctx context.Context) (bool, error)

func (*InlineMigration) Cleanup

func (im *InlineMigration) Cleanup(ctx context.Context) error

func (*InlineMigration) Hook

func (im *InlineMigration) Hook(ctx context.Context) (*storage.Client, error)

func (*InlineMigration) Name

func (im *InlineMigration) Name() string

type Migrator

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

func New

func New(ri roles.Instance) *Migrator

func (*Migrator) AddMigration

func (mi *Migrator) AddMigration(migration roles.Migration)

func (*Migrator) GetClusterVersion

func (mi *Migrator) GetClusterVersion(ctx context.Context) (*semver.Version, error)

func (*Migrator) Run

func (mi *Migrator) Run(ctx context.Context) (*storage.Client, error)

Jump to

Keyboard shortcuts

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