feat: set labels in NodeContext/Info

This commit is contained in:
2025-08-29 20:21:11 +02:00
parent d3a9802ec9
commit fe045804cb
7 changed files with 61 additions and 42 deletions

View File

@@ -9,23 +9,21 @@
using namespace std;
NodeContext ctx;
NodeContext ctx({
{"app", "base"},
{"role", "demo"}
});
NetworkManager network(ctx);
TaskManager taskManager(ctx);
ClusterManager cluster(ctx, taskManager);
ApiServer apiServer(ctx, taskManager, ctx.config.api_server_port);
void setup() {
Serial.begin(115200);
// Setup WiFi first
network.setupWiFi();
// Add example labels for this node
auto it = ctx.memberList->find(ctx.hostname);
if (it != ctx.memberList->end()) {
it->second.labels["app"] = "base";
it->second.labels["role"] = "demo";
}
// Initialize and start all tasks
taskManager.initialize();