feat(proxy): Add reverse proxy feature
This commit is contained in:
34
app/config/database.go
Normal file
34
app/config/database.go
Normal file
@@ -0,0 +1,34 @@
|
||||
package config
|
||||
|
||||
import "git.secnex.io/secnex/api-gateway/utils"
|
||||
|
||||
type Database struct {
|
||||
Host string
|
||||
Port int
|
||||
User string
|
||||
Password string
|
||||
Database string
|
||||
SSLMode string
|
||||
}
|
||||
|
||||
func NewDatabaseConfiguration(host string, port int, user string, password string, database string, sslmode string) Database {
|
||||
return Database{
|
||||
Host: host,
|
||||
Port: port,
|
||||
User: user,
|
||||
Password: password,
|
||||
Database: database,
|
||||
SSLMode: sslmode,
|
||||
}
|
||||
}
|
||||
|
||||
func NewDatabaseConfigurationFromEnv() Database {
|
||||
return NewDatabaseConfiguration(
|
||||
utils.GetEnv("DATABASE_HOST", "localhost"),
|
||||
utils.GetEnvInt("DATABASE_PORT", 5432),
|
||||
utils.GetEnv("DATABASE_USER", "postgres"),
|
||||
utils.GetEnv("DATABASE_PASSWORD", "postgres"),
|
||||
utils.GetEnv("DATABASE_NAME", "secnex"),
|
||||
utils.GetEnv("DATABASE_SSLMODE", "disable"),
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user