chore: scaffold project workbench
This commit is contained in:
26
backend/internal/config/config.go
Normal file
26
backend/internal/config/config.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package config
|
||||
|
||||
import "os"
|
||||
|
||||
type Config struct {
|
||||
Env string
|
||||
DatabaseURL string
|
||||
StorageDir string
|
||||
SystemAIKey string
|
||||
}
|
||||
|
||||
func Load() Config {
|
||||
return Config{
|
||||
Env: getenv("APP_ENV", "development"),
|
||||
DatabaseURL: getenv("DATABASE_URL", "postgres://agent:agent@localhost:5432/agent?sslmode=disable"),
|
||||
StorageDir: getenv("STORAGE_DIR", "./data/files"),
|
||||
SystemAIKey: os.Getenv("SYSTEM_AI_KEY"),
|
||||
}
|
||||
}
|
||||
|
||||
func getenv(key string, fallback string) string {
|
||||
if value := os.Getenv(key); value != "" {
|
||||
return value
|
||||
}
|
||||
return fallback
|
||||
}
|
||||
Reference in New Issue
Block a user