config

package
v0.0.0-...-3226211 Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2016 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// MigrationsTableName is the table name where migrations are logged in the database.
	MigrationsTableName = defaultMigrationsTableName

	// MigrationsPath is the location that migration files will loaded from the filesystem.
	MigrationsPath = defaultMigrationsPath

	// DBDriver is the driver to use when interfacing with the database.
	DBDriver string

	// DBHost is the host address when the database is running.
	DBHost string

	// DBPort is the port the database is running on.
	DBPort string

	// DBName is the database name to preform migrations on.
	DBName string

	// DBUser is the username to use when preforming migrations.
	DBUser string

	// DBPassword is the password to use for the database user.
	DBPassword string

	// ErrUnknownDBDriver is raised when the database driver is not `mysql` or `postgres`
	ErrUnknownDBDriver = errors.New("DB_DRIVER is unknown, must be either `mysql` or `postgres`")

	// ErrNoDBHost is raised when there is no DB_HOST in the environment variables
	ErrNoDBHost = errors.New("DB_HOST not found in environment variables")

	// ErrNoDBName is raised when there is no DB_NAME in the environment variables
	ErrNoDBName = errors.New("DB_NAME not found in environment variables")
)

Functions

func InitEnv

func InitEnv() error

InitEnv initializes the environment variables. An attempt will be made to load variables from a `.env`, this can silently fail, so long as validation passes for the required variables.

func IsTestEnv

func IsTestEnv() bool

IsTestEnv returns true when the ENV=test

Types

This section is empty.

Jump to

Keyboard shortcuts

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