Products app
This commit is contained in:
24
products/app/cfg/config.go
Normal file
24
products/app/cfg/config.go
Normal file
@ -0,0 +1,24 @@
|
||||
package cfg
|
||||
|
||||
import (
|
||||
"github.com/kelseyhightower/envconfig"
|
||||
)
|
||||
|
||||
type configStruct struct {
|
||||
DbHost string `default:"localhost"`
|
||||
DbPort int `default:"55432"`
|
||||
DbName string `default:"komponiranje"`
|
||||
DbUser string `default:"pero"`
|
||||
DbPassword string `default:"pero.000"`
|
||||
}
|
||||
|
||||
const ENV_PREFIX = ""
|
||||
|
||||
var Config configStruct
|
||||
|
||||
func init() {
|
||||
err := envconfig.Process(ENV_PREFIX, &Config)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user