fix():
This commit is contained in:
@@ -22,27 +22,17 @@ type Config struct {
|
||||
DBPassword string
|
||||
DBName string
|
||||
RedisURI string
|
||||
AuthGRPCAddr string
|
||||
CacheEnabled bool
|
||||
}
|
||||
|
||||
func Load() (*Config, error) {
|
||||
_ = godotenv.Load()
|
||||
|
||||
return &Config{
|
||||
GRPCPort: mustGetInt("GRPC_PORT", 50051), //nolint:mnd // false-positive
|
||||
GRPCEnableReflection: mustGetBool("GRPC_ENABLE_REFLECTION", false),
|
||||
EnableHTTPHandler: mustGetBool("HTTP_HANDLER_ENABLE", false),
|
||||
HTTPPort: mustGetInt("HTTP_PORT", 8080), //nolint:mnd // false-positive
|
||||
LogLevel: getEnv("LOG_LEVEL", "info"),
|
||||
DBHost: getEnv("POSTGRES_HOST", "localhost"),
|
||||
DBPort: mustGetInt("POSTGRES_PORT", 5432), //nolint:mnd // false-positive
|
||||
DBUser: getEnv("POSTGRES_USERNAME", "postgres"),
|
||||
DBPassword: getEnv("POSTGRES_PASSWORD", "postgres"),
|
||||
DBName: getEnv("POSTGRES_DATABASE", "postgres"),
|
||||
RedisURI: getEnv("REDIS_URI", "redis://localhost:6379"),
|
||||
AuthGRPCAddr: getEnv("AUTH_GRPC_ADDR", "localhost:50052"),
|
||||
CacheEnabled: mustGetBool("CACHE_ENABLED", true),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user