handleMessage handles different message types
(wsConn *WebSocketConnection, msg *WebSocketMessage)
| 198 | |
| 199 | // handleMessage handles different message types |
| 200 | func (h *WebSocketHandler) handleMessage(wsConn *WebSocketConnection, msg *WebSocketMessage) { |
| 201 | switch msg.Type { |
| 202 | case "chat": |
| 203 | h.handleChat(wsConn, msg.Payload) |
| 204 | case "ping": |
| 205 | h.sendMessage(wsConn, "pong", nil) |
| 206 | case "todo_list_request": |
| 207 | h.handleTodoListRequest(wsConn, msg.Payload) |
| 208 | case "todo_create": |
| 209 | h.handleTodoCreate(wsConn, msg.Payload) |
| 210 | case "todo_update": |
| 211 | h.handleTodoUpdate(wsConn, msg.Payload) |
| 212 | case "todo_delete": |
| 213 | h.handleTodoDelete(wsConn, msg.Payload) |
| 214 | case "tool:control", "tool_control": |
| 215 | h.handleToolControl(wsConn, msg.Payload) |
| 216 | case "permission_decision": |
| 217 | h.handlePermissionDecision(wsConn, msg.Payload) |
| 218 | default: |
| 219 | h.sendError(wsConn, "unknown_message_type", "Unknown message type: "+msg.Type) |
| 220 | } |
| 221 | } |
| 222 | |
| 223 | // handleChat handles chat messages |
| 224 | func (h *WebSocketHandler) handleChat(wsConn *WebSocketConnection, payload map[string]any) { |
no test coverage detected