- Add worker storage layer with PostgreSQL/sqlc setup - Add migration files for worker backbone schema - Add job runner and built-in jobs implementation - Add Redis key definitions for worker state management - Archive socket-session-loop milestone (completed/renamed) - Update roadmap current.md and foundation-alignment phase - Add socket endpoint integration and runtime smoke tests - Add infra-check, worker-storage-check, worker-storage-gen CLI tools - Update API socket server and config - Add pubspec dependencies and client socket endpoint changes - Add config tests for API and worker services
26 lines
591 B
Go
26 lines
591 B
Go
package config
|
|
|
|
import "os"
|
|
|
|
type Config struct {
|
|
DatabaseURL string
|
|
RedisURL string
|
|
RedisKeyPrefix string
|
|
WorkerQueue string
|
|
}
|
|
|
|
func Load() Config {
|
|
return Config{
|
|
DatabaseURL: getenv("DATABASE_URL", "postgres://alt:alt@localhost:5432/alt?sslmode=disable"),
|
|
RedisURL: getenv("REDIS_URL", "redis://localhost:6379/0"),
|
|
RedisKeyPrefix: getenv("ALT_REDIS_KEY_PREFIX", "alt"),
|
|
WorkerQueue: getenv("ALT_WORKER_QUEUE", "default"),
|
|
}
|
|
}
|
|
|
|
func getenv(key, fallback string) string {
|
|
if value := os.Getenv(key); value != "" {
|
|
return value
|
|
}
|
|
return fallback
|
|
}
|