websocket

package
v0.1.17 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

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) 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

func (h *Handler) RemoveRoom(roomID string)

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 当前的运行态快照。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL