migrator

package
v2.0.0-...-ec95b3c Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Migration0001

type Migration0001 struct{}

func (Migration0001) Migrate

func (m Migration0001) Migrate(migrator *Migrator) (Result, error)

Migrate creates the spaces directory structure

func (Migration0001) Rollback

func (Migration0001) Rollback(_ *Migrator) (Result, error)

Rollback is not implemented

type Migration0002

type Migration0002 struct{}

func (Migration0002) Migrate

func (m Migration0002) Migrate(migrator *Migrator) (Result, error)

Migrate migrates spacetypes to indexes

func (Migration0002) Rollback

func (Migration0002) Rollback(_ *Migrator) (Result, error)

Rollback is not implemented

type Migration0003

type Migration0003 struct{}

func (Migration0003) Migrate

func (m Migration0003) Migrate(migrator *Migrator) (Result, error)

Migrate migrates the file metadata to the current backend. Only the xattrs -> messagepack path is supported.

func (Migration0003) Rollback

func (Migration0003) Rollback(_ *Migrator) (Result, error)

Rollback is not implemented

type Migration0004

type Migration0004 struct{}

func (Migration0004) Migrate

func (Migration0004) Migrate(migrator *Migrator) (Result, error)

Migrate migrates the directory tree based space indexes to messagepack

func (Migration0004) Rollback

func (Migration0004) Rollback(m *Migrator) (Result, error)

Rollback migrates the directory messagepack indexes to symlinks

type Migration0005

type Migration0005 struct{}

func (Migration0005) Migrate

func (Migration0005) Migrate(migrator *Migrator) (Result, error)

Migrate fixes the messagepack space index data structure

func (Migration0005) Rollback

func (Migration0005) Rollback(migrator *Migrator) (Result, error)

Rollback rolls back the migration

type MigrationState

type MigrationState struct {
	State   string
	Message string
}

MigrationState holds the state of a migration

type Migrator

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

Migrator runs migrations on an existing decomposedfs

func New

func New(lu node.PathLookup, log *zerolog.Logger) Migrator

New returns a new Migrator instance

func (*Migrator) Migrations

func (m *Migrator) Migrations() (map[string]MigrationState, error)

Migrations returns the list of migrations and their states

func (*Migrator) RunMigration

func (m *Migrator) RunMigration(id string, rollback bool) error

RunMigration runs or rolls back a migration

func (*Migrator) RunMigrations

func (m *Migrator) RunMigrations() error

RunMigrations runs all migrations in sequence. Note this sequence must not be changed or it might damage existing decomposed fs.

type Result

type Result string

Result represents the result of a migration run

Jump to

Keyboard shortcuts

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