This commit is contained in:
Eden Kirin
2024-01-13 19:46:34 +01:00
parent dd62931b16
commit 59252abafb
4 changed files with 33 additions and 11 deletions

View 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)
}
}