Documentation
¶
Index ¶
- type Handler
- func (h *Handler) BroadcastDirectoryChanged(ctx context.Context, reason string, data map[string]any)
- 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) BroadcastScheduledTaskChanged(ctx context.Context, event protocol.CronTaskEvent)
- 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, goals *goalsvc.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) BroadcastDirectoryChanged ¶ added in v0.1.21
func (h *Handler) BroadcastDirectoryChanged(ctx context.Context, reason string, data map[string]any)
BroadcastDirectoryChanged 广播目录失效事件,前端收到后通过 REST 重新拉取快照。
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) BroadcastScheduledTaskChanged ¶ added in v0.1.21
func (h *Handler) BroadcastScheduledTaskChanged(ctx context.Context, event protocol.CronTaskEvent)
BroadcastScheduledTaskChanged 广播定时任务失效事件,避免前端高频轮询。
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 当前的运行态快照。
Source Files
¶
- goal_event_broadcaster.go
- handler.go
- handler_appserver_goal_rpc.go
- handler_broadcast.go
- handler_connection.go
- handler_control.go
- handler_dispatch.go
- handler_error.go
- handler_room_subscription.go
- handler_session_binding.go
- handler_values.go
- live_workspace.go
- registry_app_event_subscription.go
- registry_appserver_goal_rpc.go
- registry_room_subscription.go
- registry_workspace_runtime.go
- registry_workspace_subscription.go
Click to show internal directories.
Click to hide internal directories.