Documentation
¶
Index ¶
- type Handler
- func (h *Handler) BroadcastRoomEvent(ctx context.Context, roomID string, eventType protocol.EventType, ...)
- func (h *Handler) BroadcastRoomResyncRequired(ctx context.Context, roomID string, conversationID string, reason string)
- func (h *Handler) HandleWebSocket(writer http.ResponseWriter, request *http.Request)
- func (h *Handler) RemoveRoom(roomID string)
- type RuntimeSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler 封装 WebSocket 生命周期与控制消息分发。
func NewHandler ¶
func NewHandler( api *handlershared.API, roomService *roompkg.Service, roomRealtime *roompkg.RealtimeService, dm *dmsvc.Service, permission *permissionctx.Context, runtime *runtimectx.Manager, channels *channelspkg.Router, workspaceService *workspacepkg.Service, runtimeProvider func(string) RuntimeSnapshot, allowedOrigins []string, ) *Handler
NewHandler 创建 WebSocket handler。
func (*Handler) BroadcastRoomEvent ¶
func (h *Handler) BroadcastRoomEvent( ctx context.Context, roomID string, eventType protocol.EventType, data map[string]any, )
BroadcastRoomEvent 广播共享 room 事件。
func (*Handler) BroadcastRoomResyncRequired ¶
func (h *Handler) BroadcastRoomResyncRequired( ctx context.Context, roomID string, conversationID string, reason string, )
BroadcastRoomResyncRequired 广播 chat resync 通知。
func (*Handler) HandleWebSocket ¶
func (h *Handler) HandleWebSocket(writer http.ResponseWriter, request *http.Request)
HandleWebSocket 处理 WebSocket 会话。
func (*Handler) RemoveRoom ¶
RemoveRoom 从 chat 广播注册表中移除目标 room。
type RuntimeSnapshot ¶
type RuntimeSnapshot struct {
AgentID string `json:"agent_id"`
RunningTaskCount int `json:"running_task_count"`
Status string `json:"status"`
}
RuntimeSnapshot 描述某个 agent 当前的运行态快照。
Click to show internal directories.
Click to hide internal directories.