This commit is contained in:
Mike Schwörer 2023-01-06 02:03:10 +01:00
parent 14bba38324
commit 3343285761
Signed by: Mikescher
GPG Key ID: D3C7172E0A70F8CF
3 changed files with 7 additions and 5 deletions

View File

@ -16,9 +16,9 @@ type Config struct {
LogLevel zerolog.Level `env:"SCN_LOGLEVEL"`
ServerIP string `env:"SCN_IP"`
ServerPort string `env:"SCN_PORT"`
DBMain DBConfig `envprefix:"SCN_DB_MAIN_"`
DBRequests DBConfig `envprefix:"SCN_DB_REQUESTS_"`
DBLogs DBConfig `envprefix:"SCN_DB_LOGS_"`
DBMain DBConfig `env:"SCN_DB_MAIN"`
DBRequests DBConfig `env:"SCN_DB_REQUESTS"`
DBLogs DBConfig `env:"SCN_DB_LOGS"`
RequestTimeout time.Duration `env:"SCN_REQUEST_TIMEOUT"`
RequestMaxRetry int `env:"SCN_REQUEST_MAXRETRY"`
RequestRetrySleep time.Duration `env:"SCN_REQUEST_RETRYSLEEP"`
@ -377,7 +377,7 @@ func GetConfig(ns string) (Config, bool) {
}
if cfn, ok := allConfig[ns]; ok {
c := cfn()
err := confext.ApplyEnvOverrides(&c)
err := confext.ApplyEnvOverrides(&c, "_")
if err != nil {
panic(err)
}

View File

@ -7,7 +7,7 @@ require (
github.com/jmoiron/sqlx v1.3.5
github.com/mattn/go-sqlite3 v1.14.16
github.com/rs/zerolog v1.28.0
gogs.mikescher.com/BlackForestBytes/goext v0.0.50
gogs.mikescher.com/BlackForestBytes/goext v0.0.55
gopkg.in/loremipsum.v1 v1.1.0
)

View File

@ -77,6 +77,8 @@ gogs.mikescher.com/BlackForestBytes/goext v0.0.49 h1:Ro62ZyJW22elAJKT0XlY94LzAv0
gogs.mikescher.com/BlackForestBytes/goext v0.0.49/go.mod h1:ZEXyKUr8t0EKdPN1FYdk0klY7N8OwXxipGE9lWgpVE8=
gogs.mikescher.com/BlackForestBytes/goext v0.0.50 h1:WuhfxFVyywR7J4+hSTTW/wE87aFbGk7q22TGYusPg0s=
gogs.mikescher.com/BlackForestBytes/goext v0.0.50/go.mod h1:ZEXyKUr8t0EKdPN1FYdk0klY7N8OwXxipGE9lWgpVE8=
gogs.mikescher.com/BlackForestBytes/goext v0.0.55 h1:mzX/s+EBhnaRbiz3+6iwDJyJFS0F+jkbssiLDr9eJYY=
gogs.mikescher.com/BlackForestBytes/goext v0.0.55/go.mod h1:ZEXyKUr8t0EKdPN1FYdk0klY7N8OwXxipGE9lWgpVE8=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.4.0 h1:UVQgzMY87xqpKNgb+kDsll2Igd33HszWHFLmpaRMq/8=
golang.org/x/crypto v0.4.0/go.mod h1:3quD/ATkf6oY+rnes5c3ExXTbLc8mueNue5/DoinL80=