config

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CONNECTION = "MIG_CONNECTION"
	MIGRATIONS = "MIG_MIGRATIONS"
)
View Source
const (
	DEF_MIG_DIR = "./migrations"
)
View Source
const (
	MIGRC = ".migrc"
)

Variables

This section is empty.

Functions

func SetEnvFromConfigFile

func SetEnvFromConfigFile(migRcPath string) error

Check the current working directory of the process for a .migrc file. If the file is found then read the contents and set it as environment variables. Existing environment variables are not overwritten in this manner. If a file isn't found in the current directory then check the parent directory. This repeats until reaching the root directory.

Types

type MigConfig

type MigConfig struct {
	Connection string // DB connection string
	Migrations string // migrations directory, e.g. ./migrations
	MigRcPath  string // override path to config file
	OutputJson bool   // stdout should be valid JSON
}

func GetConfig

func GetConfig() (MigConfig, []string, *result.Response)

func GetConfigFromEnvVars

func GetConfigFromEnvVars() (MigConfig, error)

func GetConfigFromProcessFlags

func GetConfigFromProcessFlags() (MigConfig, []string, error)

Jump to

Keyboard shortcuts

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