78e3f450c2
- Fix: Session history flash (race condition + WS guard) - Fix: Chat background overlay + sidebar transparency - Fix: IoT device control (Chinese action names, status field) - Feat: Independent memory-service (port 8091, 13 endpoints) - Feat: Independent tool-engine service (port 8092, 13 tools) - Feat: Tool call logs with paginated DevTools panel - Feat: Thinking log records with DevTools panel - Feat: Future development roadmap document - Chore: Updated .gitignore, go.work, DevTools config - Chore: 5-service health check, project review docs
31 lines
579 B
Go
31 lines
579 B
Go
package config
|
|
|
|
import (
|
|
"os"
|
|
)
|
|
|
|
// Config 工具引擎服务配置
|
|
type Config struct {
|
|
Port string
|
|
IoTServiceURL string
|
|
DataDir string
|
|
DBUrl string
|
|
}
|
|
|
|
// Load 从环境变量加载配置
|
|
func Load() *Config {
|
|
return &Config{
|
|
Port: getEnv("PORT", "8092"),
|
|
IoTServiceURL: getEnv("IOT_SERVICE_URL", "http://localhost:8083"),
|
|
DataDir: getEnv("DATA_DIR", "/tmp/cyrene_data"),
|
|
DBUrl: getEnv("DB_URL", ""),
|
|
}
|
|
}
|
|
|
|
func getEnv(key, fallback string) string {
|
|
if v := os.Getenv(key); v != "" {
|
|
return v
|
|
}
|
|
return fallback
|
|
}
|