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

Struct Hub

internal/nodehub/hub.go:91–106  ·  view source on GitHub ↗

Hub 维护 nodeID → 连接 的注册表,并实现 NodeAgentServer。

Source from the content-addressed store, hash-verified

89
90// Hub 维护 nodeID → 连接 的注册表,并实现 NodeAgentServer。
91type Hub struct {
92 nodev1.UnimplementedNodeAgentServer
93
94 logger *slog.Logger
95 pushHandler PushHandler
96 peerExtractor PeerExtractor
97 onNodeConnected func(nodeID, peerIP string)
98
99 deadConnTimeout time.Duration
100 reaperInterval time.Duration
101
102 mu sync.RWMutex
103 conns map[string]*conn
104
105 metrics *metrics
106}
107
108type conn struct {
109 hub *Hub

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected