envs added

This commit is contained in:
nquidox 2026-02-23 19:33:36 +03:00
parent f56a39d065
commit 524f77b7e5
2 changed files with 7 additions and 1 deletions

View file

@ -1,9 +1,11 @@
#[App] #[App]
APP_LOG_LVL= APP_LOG_LVL=
APP_MODE=
#[Http] #[Http]
HTTP_HOST= HTTP_HOST=
HTTP_PORT= HTTP_PORT=
HTTP_PREFIX=
GIN_MODE= GIN_MODE=
#[gRPC] #[gRPC]

View file

@ -10,11 +10,13 @@ type Config struct {
type App struct { type App struct {
LogLvl string LogLvl string
Mode string
} }
type Http struct { type Http struct {
Host string Host string
Port string Port string
Prefix string
GinMode string GinMode string
} }
@ -28,11 +30,13 @@ func NewConfig() Config {
return Config{ return Config{
App: App{ App: App{
LogLvl: getEnv("APP_LOG_LVL", "debug"), LogLvl: getEnv("APP_LOG_LVL", "debug"),
Mode: getEnv("APP_MODE", "dev"),
}, },
Http: Http{ Http: Http{
Host: getEnv("HTTP_HOST", "0.0.0.0"), Host: getEnv("HTTP_HOST", "0.0.0.0"),
Port: getEnv("HTTP_PORT", "41082"), Port: getEnv("HTTP_PORT", "41083"),
Prefix: getEnv("HTTP_PREFIX", "/api/v2"),
GinMode: getEnv("GIN_MODE", "dev"), GinMode: getEnv("GIN_MODE", "dev"),
}, },