init socle

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-06-13 11:40:06 +02:00
commit 599479d746
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
12 changed files with 400 additions and 0 deletions

24
internal/config/config.go Normal file
View file

@ -0,0 +1,24 @@
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
}