717ad65b05
- Plugin SDK: Plugin/Tool/ComplexTool/HostAPI 标准化接口 - Plugin Manager: 插件生命周期管理 (Install/Enable/Disable/Uninstall/Reload) - Tool Registry: 聚合工具注册表 (Register/Execute/Dispatch) - 13 个内置插件: 将原有硬编码工具迁移为标准插件格式 - REST API: 11 个端点 (net/http, 零外部依赖) - ai-core 集成: PluginManagerClient 替代本地工具调用 - plugin.json 元数据: 每个插件含完整 author/version/category/permissions Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
33 lines
540 B
Go
33 lines
540 B
Go
package config
|
|
|
|
import "os"
|
|
|
|
type Config struct {
|
|
Port string
|
|
Env string
|
|
DataDir string
|
|
IoTSvcURL string
|
|
}
|
|
|
|
func Load() *Config {
|
|
cfg := &Config{
|
|
Port: "8094",
|
|
Env: "development",
|
|
DataDir: "./data",
|
|
IoTSvcURL: "http://localhost:8093",
|
|
}
|
|
if v := os.Getenv("PORT"); v != "" {
|
|
cfg.Port = v
|
|
}
|
|
if v := os.Getenv("ENV"); v != "" {
|
|
cfg.Env = v
|
|
}
|
|
if v := os.Getenv("DATA_DIR"); v != "" {
|
|
cfg.DataDir = v
|
|
}
|
|
if v := os.Getenv("IOT_SERVICE_URL"); v != "" {
|
|
cfg.IoTSvcURL = v
|
|
}
|
|
return cfg
|
|
}
|