@@ -6,9 +6,10 @@ import (
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
Server ServerConfig
|
||||
Auth AuthConfig
|
||||
DB DBConfig
|
||||
Server ServerConfig
|
||||
Auth AuthConfig
|
||||
DB DBConfig
|
||||
Charger ChargerConfig
|
||||
}
|
||||
|
||||
type ServerConfig struct {
|
||||
@@ -25,6 +26,10 @@ type DBConfig struct {
|
||||
DSN string
|
||||
}
|
||||
|
||||
type ChargerConfig struct {
|
||||
Host string
|
||||
}
|
||||
|
||||
func Load() *Config {
|
||||
return &Config{
|
||||
Server: ServerConfig{
|
||||
@@ -38,6 +43,9 @@ func Load() *Config {
|
||||
DB: DBConfig{
|
||||
DSN: getEnv("ENERGY_DB_DSN", "postgres://energy:changeme@localhost:5433/energy"),
|
||||
},
|
||||
Charger: ChargerConfig{
|
||||
Host: getEnv("ENERGY_CHARGER_HOST", ""),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user