examples/

directory
v1.54.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: MIT

README

Examples

Runnable examples for embedding and using ygo. Each is a go run-able program with its own README. collab-server and offline-first use the SQLite store, so each is a module of its own: run them from their directory (cd examples/collab-server && go run .). Run ./tools/go-work.sh once at the repository root first: they then build against this checkout (a release tag's checkout does not carry their checksums of that release, which are committed after its tags; without a workspace, go mod tidy in the example's directory fetches them). collab-client is part of the core module (go run ./examples/collab-client).

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.

Jump to

Keyboard shortcuts

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