migrations

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2020 License: MIT Imports: 7 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

Jump to

Keyboard shortcuts

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