MCPcopy Create free account
hub / github.com/0xUnixIO/pulse / mockHub

Struct mockHub

internal/nodeagent/agent_test.go:28–32  ·  view source on GitHub ↗

mockHub 是测试用的 NodeAgentServer 实现,只关心: - 接收 hello / 普通响应 / event push(usage_push 等) - 主动下发 ServerMessage(包括 cancel_id、ack) - 模拟服务端断开

Source from the content-addressed store, hash-verified

26// - 主动下发 ServerMessage(包括 cancel_id、ack)
27// - 模拟服务端断开
28type mockHub struct {
29 nodev1.UnimplementedNodeAgentServer
30
31 sessions chan *mockSession // 每次 Session 进来都丢进来
32}
33
34func newMockHub() *mockHub {
35 return &mockHub{sessions: make(chan *mockSession, 16)}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected