migrate

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: May 7, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Overview

Package migrate defines migrations for qri configuration files

Index

Constants

This section is empty.

Variables

View Source
var (

	// ErrNeedMigration indicates a migration is required
	ErrNeedMigration = fmt.Errorf("migration required")
	// ErrMigrationSucceeded indicates a migration completed executing
	ErrMigrationSucceeded = errors.New("migration succeeded")
)

Functions

func OneToTwo added in v0.9.9

func OneToTwo(cfg *config.Config) error

OneToTwo migrates a configuration from Revision 1 to Revision 2

func RunMigrations

func RunMigrations(streams ioes.IOStreams, cfg *config.Config, shouldRun func() bool, errorOnSuccess bool) (err error)

RunMigrations executes migrations. if a migration is required, the shouldRun func is called, and exits without migrating if shouldRun returns false. if errorOnSuccess is true, a completed migration will return ErrMigrationSucceeded instead of nil

func TwoToThree added in v0.10.0

func TwoToThree(cfg *config.Config) error

TwoToThree migrates a configuration from Revision 2 to Revision 3

func ZeroToOne

func ZeroToOne(cfg *config.Config) error

ZeroToOne migrates a configuration from Revision Zero (no revision number) to Revision 1

Types

This section is empty.

Jump to

Keyboard shortcuts

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