mockHub 是测试用的 NodeAgentServer 实现,只关心: - 接收 hello / 普通响应 / event push(usage_push 等) - 主动下发 ServerMessage(包括 cancel_id、ack) - 模拟服务端断开
| 26 | // - 主动下发 ServerMessage(包括 cancel_id、ack) |
| 27 | // - 模拟服务端断开 |
| 28 | type mockHub struct { |
| 29 | nodev1.UnimplementedNodeAgentServer |
| 30 | |
| 31 | sessions chan *mockSession // 每次 Session 进来都丢进来 |
| 32 | } |
| 33 | |
| 34 | func newMockHub() *mockHub { |
| 35 | return &mockHub{sessions: make(chan *mockSession, 16)} |
nothing calls this directly
no outgoing calls
no test coverage detected