config

package
v0.0.0-...-ac98336 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2016 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvironmentVariableName = "ECHO_ENV"
	Development             = "development"
	Test                    = "test"
	Production              = "production"
)

Variables

View Source
var DB *gorm.DB

DB is the connection pool of Postgres database

View Source
var Log = logrus.New()

Log is an instance of Logrus logger

Functions

func DatabaseName

func DatabaseName() string

func Env

func Env() string

func InitDB

func InitDB()

func SetEnv

func SetEnv(environment string)

Types

type Config

type Config struct {
	Version string `env:"APP_VERSION"`

	DatabasePool     int    `env:"BREIZHTRIP_DATABASE_POOL" envDefault:"20"`
	DatabaseHost     string `env:"BREIZHTRIP_DATABASE_HOST" envDefault:"localhost"`
	DatabasePort     string `env:"BREIZHTRIP_DATABASE_PORT" envDefault:"5432"`
	DatabaseUsername string `env:"BREIZHTRIP_DATABASE_USERNAME" envDefault:"postgres"`
	DatabasePassword string `env:"BREIZHTRIP_DATABASE_PASSWORD" envDefault:"postgres"`
}

Config holds all configuration for our program

var Cfg *Config

Jump to

Keyboard shortcuts

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