feat: 接线 serve 真实 auth/注册/管理/MQTT 与消息循环

This commit is contained in:
Nixevol
2026-09-30 07:56:25 +08:00
parent 550ed534e4
commit 0efcfbb8b6
9 changed files with 699 additions and 80 deletions
+11
View File
@@ -67,6 +67,17 @@ func (c *MemoryConns) Current(endpointID string) (LiveConn, bool) {
return v, ok
}
// Snapshot 返回当前连接表副本(供推送循环遍历)。
func (c *MemoryConns) Snapshot() map[string]LiveConn {
c.mu.RLock()
defer c.mu.RUnlock()
out := make(map[string]LiveConn, len(c.m))
for k, v := range c.m {
out[k] = v
}
return out
}
// RecordingDownlink 记录下行发布,供测试断言。
type RecordingDownlink struct {
mu sync.Mutex