migrations

package
v0.36.4 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2019 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunMigrations

func RunMigrations(fs afero.Fs, configFile string, forceApply bool) error

RunMigrations cycles through a list of migrations and applies them if necessary

Types

type JSONToYamlMigration

type JSONToYamlMigration struct {
}

JSONToYamlMigration Defines a fogg json to yaml config file migration

func (*JSONToYamlMigration) Description

func (m *JSONToYamlMigration) Description() string

Description Describes the filetype migration taking place

func (*JSONToYamlMigration) Guard

func (m *JSONToYamlMigration) Guard(fs afero.Fs, configFile string) (bool, error)

Guard Checks to see if config file needs to be converted to .yml

func (*JSONToYamlMigration) Migrate

func (m *JSONToYamlMigration) Migrate(fs afero.Fs, configFile string) (string, error)

Migrate method converts fogg.json to fogg.yml

func (*JSONToYamlMigration) Prompt

func (m *JSONToYamlMigration) Prompt() bool

Prompt Checks to see if the user wants their config file to be migrated to yml

type Migration

type Migration interface {
	Description() string                      //Describes the migration taking
	Guard(afero.Fs, string) (bool, error)     //Returns true if migration is runnable, otherwise error
	Migrate(afero.Fs, string) (string, error) //Returns path to config and err
	Prompt() bool                             //Returns whether the user would like to run the migration
}

Migration Defines a fogg migration and the actions that it can perform

type VersionUpgradeMigration

type VersionUpgradeMigration struct {
}

VersionUpgradeMigration Defines a fogg version upgrade

func (*VersionUpgradeMigration) Description

func (m *VersionUpgradeMigration) Description() string

Description Describes the upgrade taking place

func (*VersionUpgradeMigration) Guard

func (m *VersionUpgradeMigration) Guard(fs afero.Fs, configFile string) (bool, error)

Guard Checks the version of the config file and determines whether an upgrade is necessary

func (*VersionUpgradeMigration) Migrate

func (m *VersionUpgradeMigration) Migrate(fs afero.Fs, configFile string) (string, error)

Migrate Upgrades config file to most recent version

func (*VersionUpgradeMigration) Prompt

func (m *VersionUpgradeMigration) Prompt() bool

Prompt Checks to see if the user wants their version to be upgraded

Jump to

Keyboard shortcuts

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