Skip to main content

monolith-websocket-pubsub

Use when implementing real-time functionality using the built-in websocket pub/sub layer (`/ws`), including subscribe/message protocol and channel design.

소스 정보

저장소
cggonzal/monolith
최근 소스 활동
2026년 2월 14일 03:11
감지된 SKILL.md 언어
영어
스타
0
포크
0

설치 방법

기본적으로 소스를 먼저 확인하는 Prompt가 선택됩니다. 직접 명령으로 전환하거나 로컬 사본을 다운로드할 수도 있습니다.

소스 파일 검토

설치 여부를 결정하기 전에 SKILL.md와 SkillsMP에 표시된 보조 파일을 읽어 보세요.

SKILL.md 표시 중

SKILL.md
소스 지침 · 읽기 전용 미리보기
name
monolith-websocket-pubsub
description
Use when implementing real-time functionality using the built-in websocket pub/sub layer (`/ws`), including subscribe/message protocol and channel design.
# Monolith WebSocket Pub/Sub ## Use this skill when - Building chat/live updates. - Debugging channel subscriptions or message broadcast behavior. ## Entry points - Route: `GET /ws` in `app/routes/routes.go` - Implementation: `ws/ws.go` - Persistent message model: `app/models/ws.go` ## Client protocol Send JSON commands: - Subscribe: `{"command":"subscribe","identifier":"ChatChannel"}` - Publish: `{"command":"message","identifier":"ChatChannel","data":"Hello"}` ## Server behavior - Hub tracks channel subscriptions. - `message` commands are persisted then broadcast to subscribed clients. - Client loop handles register/unregister and ping/pong lifecycle. ## Extension workflow 1. Pick channel naming strategy (room, user, domain event). 2. Add frontend websocket client logic in `static/js/application.js` or app-specific JS. 3. Optionally enforce auth checks before allowing subscribe/publish. 4. Add tests in `ws/ws_test.go` style for command handling.
GitHub에서 보기