| 424 | } |
| 425 | |
| 426 | func (e *CentralCfg) TryGetNode(node NodeId) *NodeCfg { |
| 427 | idx := slices.IndexFunc(e.Routers, func(cfg RouterCfg) bool { |
| 428 | return cfg.Id == node |
| 429 | }) |
| 430 | if idx == -1 { |
| 431 | idx = slices.IndexFunc(e.Clients, func(cfg ClientCfg) bool { |
| 432 | return cfg.Id == node |
| 433 | }) |
| 434 | if idx == -1 { |
| 435 | return nil |
| 436 | } |
| 437 | return &e.Clients[idx].NodeCfg |
| 438 | } |
| 439 | return &e.Routers[idx].NodeCfg |
| 440 | } |
| 441 | |
| 442 | func (e *CentralCfg) GetRouter(node NodeId) RouterCfg { |
| 443 | idx := slices.IndexFunc(e.Routers, func(cfg RouterCfg) bool { |