Documentation
¶
Overview ¶
Command collab-server is a runnable example of embedding the ygo WebSocket sync server in your own Go backend and wiring its library-only extension points: connection lifecycle hooks, read-only viewers, an on-change side effect, first-load seeding, resource caps, and a live stats endpoint. It is documentation, not a product — yserve (cmd/yserve) is the batteries-included CLI server; this shows what the server package exposes to code that embeds it.
Run:
go run ./examples/collab-server # in-memory go run ./examples/collab-server -store x.db # sqlite-backed
Then point any y-websocket client at
ws://localhost:8080/collab/<docName> # editor ws://localhost:8080/collab/<docName>?mode=view # read-only viewer
and GET http://localhost:8080/stats for current load.
Click to show internal directories.
Click to hide internal directories.