account/internal/config/config.go
GnomeZworc 599479d746
init socle
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2026-06-13 11:47:13 +02:00

24 lines
461 B
Go

package config
import "os"
type Config struct {
DatabaseURL string
Port string
Env string
}
func Load() *Config {
return &Config{
DatabaseURL: getenv("DATABASE_URL", "postgres://account:account@localhost:5432/account?sslmode=disable"),
Port: getenv("PORT", "8080"),
Env: getenv("ENV", "development"),
}
}
func getenv(key, fallback string) string {
if v := os.Getenv(key); v != "" {
return v
}
return fallback
}