config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvDev  = "dev"
	EnvProd = "prod"
	EnvTest = "test"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Env   string `env:"APP_ENV,default=prod"`
	Port  int    `env:"APP_PORT,default=1234"`
	Debug bool   `env:"APP_DEBUG,default=false"`
	DB    struct {
		Host     string `env:"DB_HOST,required"`
		Port     uint   `env:"DB_PORT,required"`
		User     string `env:"DB_USER,required"`
		Password string `env:"DB_PASSWORD,required"`
		Database string `env:"DB_DATABASE,required"`
		Driver   string `env:"DB_DRIVER,default=postgres"`
	}
	LogLevel       string `env:"LOG_LEVEL,default=info"`
	MetricsEnabled bool   `env:"METRICS_ENABLED,default=false"`
}

Config struct that holds application configuration

func Load

func Load() (Config, error)

Load Loads the application config

Jump to

Keyboard shortcuts

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