examples/

directory
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2026 License: MIT

README

Examples

Runnable examples for embedding and using ygo. Each is a go run-able program with its own README.

Example What it shows
collab-server Embed the WebSocket sync server and wire its hooks (OnConnect, ReadOnly, OnChange, OnLoadDocument), resource caps, a SQLite store, and a /stats endpoint
collab-client A Go-native sync client: connect, observe remote changes, edit, converge
offline-first Client-side offline persistence with a LocalStore: usable with no network, edits survive restarts and sync up on reconnect

The core CRDT API also has runnable, output-verified examples that render on pkg.go.dev (Map, Array, Text, two-document sync, UndoManager).

Directories

Path Synopsis
Command collab-client is a runnable example of the ygo Go-native sync client.
Command collab-client is a runnable example of the ygo Go-native sync client.
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.
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.
Command offline-first demonstrates the ygo client's offline-first persistence.
Command offline-first demonstrates the ygo client's offline-first persistence.

Jump to

Keyboard shortcuts

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