How corec-dev/corec works
CoreC is a headless, configuration-driven IIoT collection and control core. Operators load YAML to start an engine that schedules or subscribes to industrial-device reads, processes points through rules, and publishes them through outbound transports; commands travel back through transports to drivers. The README also documents a REST/WebSocket control plane, discovery, buffering, and observability. Those capabilities are represented from documentation and the repository tree; sampled source was incomplete, so uncertain internal wiring is omitted.
Main entry points: engine.go Core engine · driver_manager.go Driver manager · processing.go Point processing · all.go MQTT and HTTP
Components 20
Core runtime
- Config loader
config/config.go - Core engine
engine/engine.go - Read scheduler
engine/scheduler.go - Data bus
engine/databus.go - Latest-value cache
engine/cache.go
Device connectivity
- Driver manager
engine/driver_manager.go - Protocol drivers
driver/all/all.go
Data routing
- Point processing
engine/processing.go - Rule engine
rule/engine.go - Transport manager
engine/transport_manager.go - MQTT and HTTP
transport/all/all.go
Control plane
- REST and streams
hub/route/server.go - Command execution
engine/command_manager.go - Node discovery
engine/discovery.go
Observability
- Metrics and stats
engine/statistic/manager.go - Logging and tracing
common/trace/trace.go
Other components
- Operator
- Industrial devices
- MQTT broker
- API controller
Connections 23
- Operator → Config loader: supplies YAML
- Config loader → Core engine: starts runtime
- Core engine → Driver manager: manages drivers
- Core engine → Read scheduler: starts scheduler
- Read scheduler → Driver manager: schedules reads
- Driver manager → Protocol drivers: creates drivers
- Protocol drivers → Industrial devices: reads and writes
- Driver manager → Data bus: submits points
- Data bus → Point processing: delivers points
- Point processing → Latest-value cache: updates latest values
- Point processing → Rule engine: matches points
- Point processing → Transport manager: routes points
- Transport manager → MQTT and HTTP: creates transports
- MQTT and HTTP → MQTT broker: publishes and subscribes
- MQTT broker → MQTT and HTTP: delivers commands
- MQTT and HTTP → Command execution: dispatches commands
- Command execution → Driver manager: writes device values
- API controller → REST and streams: requests API
- REST and streams → Core engine: queries and controls
- Core engine → Node discovery: starts discovery
- Core engine → Metrics and stats: records statistics
- Core engine → Logging and tracing: emits telemetry
- REST and streams → Metrics and stats: exposes metrics