Discover Packages
github.com/binjamil/go-starter
pkg
config
package
Version:
v0.1.0
Opens a new window with list of versions in this module.
Published: Aug 21, 2022
License: BSD-2-Clause
Opens a new window with license information.
Imports: 3
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
type Config struct {
Env string `mapstructure:"ENV"`
HTTP `mapstructure:",squash"`
Log `mapstructure:",squash"`
PG `mapstructure:",squash"`
}
Load reads in configurations from config files and environment variables
It uses the following order to override configurations:
1. .default.env, 2. .$env.env, 3. .local.env, 4. environment variables
type HTTP struct {
Port int `mapstructure:"HTTP_PORT"`
}
type Log struct {
Level string `mapstructure:"LOG_LEVEL"`
}
type PG struct {
Host string `mapstructure:"POSTGRES_HOST"`
Database string `mapstructure:"POSTGRES_DATABASE"`
User string `mapstructure:"POSTGRES_USER"`
Password string `mapstructure:"POSTGRES_PASSWORD"`
Options string `mapstructure:"POSTGRES_OPTIONS"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.