24 lines
485 B
Go
24 lines
485 B
Go
package config
|
|
|
|
import "os"
|
|
|
|
type DatabaseConfig struct {
|
|
Host string
|
|
Port string
|
|
Login string
|
|
Password string
|
|
Database string
|
|
URL string
|
|
}
|
|
|
|
func LoadDatabaseConfig() *DatabaseConfig {
|
|
return &DatabaseConfig{
|
|
Host: os.Getenv("POSTGRES_HOST"),
|
|
Port: os.Getenv("POSTGRES_PORT"),
|
|
Login: os.Getenv("POSTGRES_LOGIN"),
|
|
Password: os.Getenv("POSTGRES_PASSWORD"),
|
|
Database: os.Getenv("POSTGRES_DATABASE"),
|
|
URL: os.Getenv("POSTGRES_URL"),
|
|
}
|
|
}
|