5c807d76a0
Extracted from Cyrene main repo (backend/pkg/plugins + backend/plugin-manager). Contains SDK interfaces (Plugin/Tool/HostAPI), 13 built-in plugins, ToolRegistry with call log ring buffer, and Plugin Manager REST API service. 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
|
|
}
|