crdt

package module
v1.0.36-beta.2 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2026 License: MIT Imports: 3 Imported by: 0

README

crdt

中文

A bounded Go CRDT library for convergent state, delta replication, recovery, and explicit protocol boundaries.

crdt provides deterministic CRDT primitives and framed binary codecs for replicas that must converge despite duplicate, reordered, or delayed delivery. It is a library, not a complete collaboration service: the host owns identity, authorization, storage, transport, membership, retention, and product invariants.

Start in three minutes

Requires Go 1.21 or later.

go get github.com/DarkInno/crdt@latest
package main

import (
	"fmt"
	"log"

	"github.com/DarkInno/crdt/counter"
)

func main() {
	left, err := counter.NewGCounter("left")
	if err != nil {
		log.Fatal(err)
	}
	right, err := counter.NewGCounter("right")
	if err != nil {
		log.Fatal(err)
	}
	if _, err := left.Increment(3); err != nil {
		log.Fatal(err)
	}
	if err := right.Merge(left); err != nil {
		log.Fatal(err)
	}
	value, err := right.Value()
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(value) // 3
}

For a checkout:

git clone https://github.com/DarkInno/crdt.git
cd crdt
make test

go test ./... at the repository root intentionally tests the dependency-free core only. make test traverses the core and every opt-in module.

What is included

  • G-Counter, PN-Counter, G-Set, add-wins OR-Set, and causal MV-Register.
  • Bounded canonical state/delta frames, deterministic snapshots, recovery plans, and persisted HLC state for reusable replica identities.
  • A local, bounded multi-type undo/redo command stack plus a content-addressed snapshot version DAG for browser history and branches; both remain outside replication frames and are host-persisted metadata.
  • RGA collaborative text with stable run-v2 frames by default, plus explicitly negotiated packed-v3 frames for dense HLC runs; stable bounded rich-text, observed-remove tree, and nested document-tree protocols; plus list and XML-fragment layers.
  • Delta batching, Merkle anti-entropy, exact-acknowledgement tombstone-GC coordination, explicit local-only cleanup for disposable state, and manifest-bound replica/inbox recovery helpers.
  • Opt-in modules for a bounded live WebSocket provider, a separate bbolt-backed durable relay with cursor replay, legacy optional state-vector catch-up, and opt-in HLC/Merkle no-state-vector anti-entropy, Redis/PostgreSQL/MySQL/SQL Server/SQLite durable-log implementations, a bounded WebRTC DataChannel bridge, and local bbolt/file checkpoint Store references.
  • Optional, manifest-negotiated compression-aware outer frame v2 with explicit v1 conversion; it does not change CRDT TypeIDs or semantics.
  • RGA diagnostic obfuscation that replaces text content while retaining an isolated debug timeline structure.

All implemented frame pairs are stable and use the zero-value ProtocolPolicy. LWW-Set/Map, scalar RGA v1, list RGA, run-v2 RGA, packed-v3 RGA, rich-text v1, and observed-remove tree v1 still require an authenticated exact manifest: a frame type alone is never a negotiated protocol, authenticated peer, or permission to compact tombstones.

Choose a path

Goal Read or run
Learn the basic APIs Getting started and runnable examples
Use named shared Map/Array objects without CRDT plumbing Shared-document guide and (cd examples && go run ./shared-document)
Choose a CRDT without hand-copying protocol IDs Intent-first setup and go run ./cmd/crdt-profile -format json
Build a complete client flow End-to-end integration
Bound a disposable local cache's tombstones Tombstone GC mode selection
Survive local restarts safely Local checkpoint Store references and (cd examples && go run ./persistent-replica)
Add replay and reconnect Durable relay reference
Choose browser, WebRTC, Redis, PostgreSQL, MySQL, SQL Server, or SQLite boundaries Provider architecture
Use a bounded live relay WebSocket provider reference
Connect stable Yjs/y-websocket clients Yjs / y-protocols compatibility relay
Run a trusted server-side agent as a durable Yjs peer Yjs agent-peer integration
Bind Quill Deltas with approved rich-text formatting Rich-text editor binding
Plan durable, deeper Yjs support safely Yjs deeper interoperability decision
Attach media without CRDT byte replication Attachment integration
Implement run-v2 outside Go/Wasm RGA run-v2 protocol and vectors
Reduce large Go/Wasm text-frame bytes without changing scalar RGA semantics Packed RGA v3 protocol and go run ./cmd/crdt-compare -protocol=packed-v3
Use the native Rust, Python, Swift, or C++ RGA/LWW-Map runtime Native type-coverage decision
Implement stable formatting or trees Rich-text v1 and observed-remove tree v1

The documentation index separates getting-started, integration, protocol/design, and operational material. Detailed performance evidence and deployment runbooks live there instead of making this entry page a manual.

Persistence and recovery

State bytes alone are not a recoverable replica for HLC-backed CRDTs. Persist the state frame, HLC state, and application delivery frontier/outbox atomically before reusing a replica ID. The opt-in persistence.Store contract has bbolt and file references for one typed CRDT schema and one active process; both validate concrete state before saving and on every load.

(cd examples && go run ./persistent-replica)
# recovered=true cursor=41 outbox_bytes=24

It is not a clustered database, authenticated transport, or generic business transaction manager. The host still owns encryption at rest, backup/restore, remote authorization, tenant isolation, membership, and tombstone lifecycle.

The durable package intentionally persists a relay operation log and replay cursor. Clients must persist their concrete CRDT checkpoint before advancing that cursor; read the local checkpoint and durable relay references together.

Modules and dependencies

The published root module, github.com/DarkInno/crdt, has no non-standard-library module dependencies. Durable storage, transports, and database backends are independently versioned opt-in modules, so a core-only consumer does not resolve their dependency graphs.

Module Opt-in capability
github.com/DarkInno/crdt/durable bbolt durable relay and WebSocket reconnect client.
github.com/DarkInno/crdt/persistence bbolt and file checkpoint Stores.
github.com/DarkInno/crdt/telemetry Bounded telemetry and opt-in OpenTelemetry metrics adapter.
github.com/DarkInno/crdt/extensions WebSocket, HTTP/SSE, gRPC, and Yjs relay references.
github.com/DarkInno/crdt/providers/{redis,postgres,mysql,mssql,sqlite,webrtc} Durable-log and DataChannel backends.
github.com/DarkInno/crdt/examples Runnable examples, including WebSocket references.

For example, an application choosing MySQL installs only the core, durable contract, and MySQL provider modules (plus its own selected driver):

go get github.com/DarkInno/crdt@latest
go get github.com/DarkInno/crdt/durable@latest
go get github.com/DarkInno/crdt/providers/mysql@latest

Package map

Package Purpose
counter, set, register Counter, set, and register CRDTs.
shared High-level named Map/Array facade over stable fully nested document-tree-v2 frames.
lww, tree, text, list, xml, richtext, documenttree HLC-backed and ordered collaborative structures.
encoding, delta, snapshot, clock Framing, bounded batches, snapshots, and HLC state.
replica, membership, tombstonegc, merkle Delivery continuity, membership, safe GC coordination, and anti-entropy.
github.com/DarkInno/crdt/persistence Opt-in local bounded bbolt and file CRDT checkpoint Store references.
history Local multi-scope undo/redo command stack and content-addressed snapshot version DAG.
config Explicit layered host configuration.
github.com/DarkInno/crdt/telemetry Opt-in bounded payload-free operational telemetry and OpenTelemetry adapter.
github.com/DarkInno/crdt/durable, github.com/DarkInno/crdt/extensions, awareness, observe Opt-in durable relay and live relay; core ephemeral presence and process-local observation.
attachment Immutable media-reference metadata; never raw media bytes.

Verify and measure

Run focused checks while changing one package:

(cd persistence && go test .)
(cd examples && go test ./persistent-replica)
(cd persistence && go test -race .)
(cd persistence && go test -run='^$' -fuzz=FuzzUnmarshalCheckpoint -fuzztime=250000x -parallel=1 .)
(cd persistence && go test -run='^$' -fuzz=FuzzUnmarshalFileRecords -fuzztime=250000x -parallel=1 .)
(cd persistence && go test -run='^$' -bench='Benchmark((File)?Store(Save|Load|SaveParallel|Delete|LoadLegacyMigration)|(File)?ConfigFromLoader)$' -benchmem -benchtime=2s .)

Repository gates:

make test
make race
make vet
make coverage
make verify

make verify also runs bounded fuzzing, static analysis, linting, integration, and extreme scenarios. make benchmark is a controlled development measure, not a production capacity promise—repeat focused benchmarks on the target disk, CPU, Go version, network, and workload before selecting limits.

For host wiring of layered configuration, structured error codes, and bounded durable-relay telemetry, see production readiness.

Boundaries that matter

  • CRC-32C, SHA-256, and a frame type detect format damage; they do not authenticate a peer. Bind exact manifests and protocol policies during an authenticated handshake.
  • A greatest observed tag is not proof of contiguous delivery or permission to retire tombstones. Use the relevant frontier, inbox, and membership contracts.
  • Both checkpoint backends require one active process and are not HA storage. bbolt has an exclusive file lock; the file reference has no inter-process lock and must never be shared by active pods.
  • The library does not enforce business invariants. Validate identity, tenant, value permissions, rate limits, retention, and backup access in the host.

Contributing and releases

Contributions should include focused tests, preserve canonical encoding, bound untrusted input before allocation or mutation, and update the closest relevant documentation. Review CONTRIBUTING.md; keep beta changes on the reviewed beta-to-preprod-to-main release path and do not manually move published tags.

License

SPDX-License-Identifier: MIT. See LICENSE.

Documentation

Overview

Package crdt provides the shared contracts and protocol capability discovery used by this module's state-based CRDT implementations.

Applications normally use a concrete data type from a subpackage, such as counter for G-Counters and PN-Counters, set for add-wins OR-Sets, or clock for hybrid logical clocks. This root package contains the common CRDT, delta, snapshot, and mutation-tag contracts those implementations share.

The framed protocol table is intentionally closed. Use ProtocolPolicy during authenticated connection setup to advertise only the state and delta frame types a replication group has agreed to exchange. Every implemented protocol pair is stable; matching TypeIDs alone still do not authenticate a peer.

For installation, examples, and package-level guidance, see the module README at https://github.com/darkinno/crdt.

Example (LwwRegister)
package main

import (
	"fmt"

	"github.com/DarkInno/crdt/register"
)

func main() {
	writer, err := register.NewLWW("writer")
	if err != nil {
		panic(err)
	}
	reader, err := register.NewLWW("reader")
	if err != nil {
		panic(err)
	}
	if err := writer.Set([]byte("healthy")); err != nil {
		panic(err)
	}
	if err := reader.Merge(writer); err != nil {
		panic(err)
	}

	value, ok := reader.Get()
	fmt.Println(ok, string(value))
}
Output:
true healthy
Example (LwwSet)
package main

import (
	"fmt"

	"github.com/DarkInno/crdt/lww"
)

func main() {
	writer, err := lww.NewSet[string]("writer")
	if err != nil {
		panic(err)
	}
	reader, err := lww.NewSet[string]("reader")
	if err != nil {
		panic(err)
	}
	if err := writer.Add("on-call"); err != nil {
		panic(err)
	}
	if err := reader.Merge(writer); err != nil {
		panic(err)
	}

	fmt.Println(reader.Contains("on-call"))
}
Output:
true
Example (MaxRegister)
package main

import (
	"fmt"

	"github.com/DarkInno/crdt/register"
)

func main() {
	local := register.NewMax()
	remote := register.NewMax()
	if err := local.Set(8); err != nil {
		panic(err)
	}
	if err := remote.Set(13); err != nil {
		panic(err)
	}
	if err := local.Merge(remote); err != nil {
		panic(err)
	}

	value, ok := local.Get()
	fmt.Println(ok, value)
}
Output:
true 13

Index

Examples

Constants

View Source
const (
	TypeIDGCounterState          uint64 = 1
	TypeIDGCounterDelta          uint64 = 3
	SemanticsVersionGCounter     uint64 = 1
	TypeIDORSetState             uint64 = 2
	TypeIDORSetDelta             uint64 = 4
	SemanticsVersionORSet        uint64 = 1
	TypeIDPNCounterState         uint64 = 5
	TypeIDPNCounterDelta         uint64 = 6
	SemanticsVersionPNCounter    uint64 = 1
	TypeIDLWWSetState            uint64 = 7
	TypeIDLWWSetDelta            uint64 = 8
	SemanticsVersionLWWSet       uint64 = 1
	TypeIDLWWMapState            uint64 = 9
	TypeIDLWWMapDelta            uint64 = 10
	SemanticsVersionLWWMap       uint64 = 1
	TypeIDRGAState               uint64 = 11
	TypeIDRGADelta               uint64 = 12
	SemanticsVersionRGA          uint64 = 1
	TypeIDGSetState              uint64 = 13
	TypeIDGSetDelta              uint64 = 14
	SemanticsVersionGSet         uint64 = 1
	TypeIDMVRegisterState        uint64 = 15
	TypeIDMVRegisterDelta        uint64 = 16
	SemanticsVersionMVRegister   uint64 = 1
	TypeIDORTreeState            uint64 = 17
	TypeIDORTreeDelta            uint64 = 18
	SemanticsVersionORTree       uint64 = 1
	TypeIDRGARunState            uint64 = 19
	TypeIDRGARunDelta            uint64 = 20
	SemanticsVersionRGARun       uint64 = 2
	TypeIDListRGAState           uint64 = 21
	TypeIDListRGADelta           uint64 = 22
	SemanticsVersionListRGA      uint64 = 1
	TypeIDRichTextState          uint64 = 23
	TypeIDRichTextDelta          uint64 = 24
	SemanticsVersionRichText     uint64 = 1
	TypeIDMoveRGAState           uint64 = 25
	TypeIDMoveRGADelta           uint64 = 26
	SemanticsVersionMoveRGA      uint64 = 2
	TypeIDRGAPackedState         uint64 = 29
	TypeIDRGAPackedDelta         uint64 = 30
	SemanticsVersionRGAPacked    uint64 = 3
	TypeIDDocumentTreeState      uint64 = 31
	TypeIDDocumentTreeDelta      uint64 = 32
	SemanticsVersionDocumentTree uint64 = 2
)

Stable frame type assignments. Values are part of the v1 wire contract and must never be reused for a different payload shape. The source of truth is docs/protocol/type-ids.json.

Variables

This section is empty.

Functions

func IsExperimentalFrame deprecated

func IsExperimentalFrame(typeID uint64) bool

IsExperimentalFrame reports whether typeID belongs to an experimental protocol. No implemented protocol is experimental; reserved and unknown IDs also return false. It remains for source compatibility with earlier policy negotiation code.

Deprecated: every implemented frame type is stable.

func MarshalDiagnosticJSON added in v1.0.5

func MarshalDiagnosticJSON(summary StateSnapshot) ([]byte, error)

MarshalDiagnosticJSON encodes a caller-provided diagnostic summary. It is useful for CRDT delta log views that use the same schema as StateSnapshot. The summary must not contain application values or replication state.

func MarshalStateJSON added in v1.0.5

func MarshalStateJSON(value StateReporter) ([]byte, error)

MarshalStateJSON returns a compact JSON diagnostic summary for value.

This helper is intended for structured logs and human inspection. It does not encode CRDT state, deltas, or opaque application values, so its output cannot reconstruct a replica and must not be used as a wire format.

func WrapError added in v1.0.25

func WrapError(code ErrorCode, operation string, cause error) error

WrapError adds a stable code and operation to cause. It returns nil when cause is nil so callers can use it in ordinary error-returning paths.

Types

type CRDT

type CRDT[T any] interface {
	Merge(other T) error
	State() StateSnapshot
}

CRDT is the common contract for state-based CRDTs.

For every concrete state type T, Merge must be commutative, associative, and idempotent. If Merge returns an error, it must leave the receiver unchanged.

type DeltaCapable

type DeltaCapable[T any, D any] interface {
	CRDT[T]
	ApplyDelta(delta D) error
}

DeltaCapable is implemented by a state-based CRDT that accepts a concrete, type-safe delta D. Delta mutators return D directly; the library does not maintain an implicitly acknowledged delta buffer.

type Error added in v1.0.25

type Error struct {
	Code      ErrorCode
	Operation string
	Cause     error
}

Error adds an operation and a stable code to a cause. Operation must be a constant diagnostic name such as "durable.new_handler"; do not put peer IDs, group IDs, endpoints, credentials, payloads, or other untrusted data in it.

Error unwraps to Cause, so existing errors.Is and errors.As checks continue to work when a package adopts structured errors at a public boundary.

func (*Error) Error added in v1.0.25

func (e *Error) Error() string

Error implements error.

func (*Error) Is added in v1.0.25

func (e *Error) Is(target error) bool

Is matches another structured Error by its non-empty code. It deliberately does not compare operation names, which are diagnostic context rather than a compatibility contract.

func (*Error) Unwrap added in v1.0.25

func (e *Error) Unwrap() error

Unwrap returns the original cause for errors.Is and errors.As compatibility.

type ErrorCode added in v1.0.25

type ErrorCode string

ErrorCode classifies a failure without requiring callers to parse an error message. Codes describe a stable operational category, not a wire protocol result or application authorization policy.

const (
	// ErrorCodeUnknown is returned when an error has no CRDT structured wrapper.
	ErrorCodeUnknown ErrorCode = "unknown"
	// ErrorCodeInvalidConfig identifies missing, malformed, or unsafe local
	// configuration before an operation begins.
	ErrorCodeInvalidConfig ErrorCode = "invalid_config"
	// ErrorCodeInvalidInput identifies rejected untrusted or malformed input.
	ErrorCodeInvalidInput ErrorCode = "invalid_input"
	// ErrorCodeUnauthorized identifies an authentication or authorization denial.
	ErrorCodeUnauthorized ErrorCode = "unauthorized"
	// ErrorCodeConflict identifies an incompatible retry or concurrent binding.
	ErrorCodeConflict ErrorCode = "conflict"
	// ErrorCodeResourceLimit identifies a configured capacity or size bound.
	ErrorCodeResourceLimit ErrorCode = "resource_limit"
	// ErrorCodeUnavailable identifies a closed or temporarily unavailable dependency.
	ErrorCodeUnavailable ErrorCode = "unavailable"
)

func ErrorCodeOf added in v1.0.25

func ErrorCodeOf(err error) ErrorCode

ErrorCodeOf returns the outermost structured error code in err's tree, or ErrorCodeUnknown when no structured wrapper is present.

type FrameType

type FrameType struct {
	StateID          uint64
	DeltaID          uint64
	SemanticsVersion uint64
	UsesHLC          bool
}

FrameType describes one fully implemented framed CRDT protocol. The type table is deliberately closed: reserving an ID alone must not make a payload eligible for batching or recovery before its concrete codec is available.

func DefaultRGAFrameType added in v1.0.19

func DefaultRGAFrameType() FrameType

DefaultRGAFrameType returns the compact run-v2 protocol for new RGA replication groups. Legacy scalar RGA v1 frames remain a separately selected stable migration contract.

func FrameTypeForDelta

func FrameTypeForDelta(deltaID uint64) (FrameType, bool)

FrameTypeForDelta returns the supported protocol associated with deltaID.

func FrameTypeForState

func FrameTypeForState(stateID uint64) (FrameType, bool)

FrameTypeForState returns the supported protocol associated with stateID.

type FrameTypeRegistration added in v1.0.25

type FrameTypeRegistration struct {
	Name string
	FrameType
}

FrameTypeRegistration identifies one implemented state/delta protocol pair. It is diagnostic and negotiation metadata only: applications must still bind an authenticated manifest, authorization policy, and resource limits before accepting a frame.

func FrameTypeRegistrationForID added in v1.0.25

func FrameTypeRegistrationForID(typeID uint64) (FrameTypeRegistration, bool)

FrameTypeRegistrationForID returns the implemented registration containing typeID as either its state or delta frame ID. Reserved and unknown IDs return false. It performs no policy, manifest, or authentication decision.

func RegisteredFrameTypes added in v1.0.25

func RegisteredFrameTypes() []FrameTypeRegistration

RegisteredFrameTypes returns a copy of every implemented protocol registration in stable registry order. Mutating the returned slice cannot affect protocol admission or frame decoding.

type ProtocolPolicy

type ProtocolPolicy struct {
	// AllowExperimental is retained for source compatibility with releases that
	// required an opt-in for collection frames. Every implemented frame type is
	// stable now, so the field has no effect. It is not a substitute for an
	// authenticated manifest, authorization, limits, or tombstone retirement.
	//
	// Deprecated: all implemented protocol pairs are included by the zero value.
	AllowExperimental bool
}

ProtocolPolicy controls which implemented frame types one replication group advertises. It is a local, immutable-by-convention value for connection setup; it does not install a process-wide switch or permit runtime protocol registration.

Peers must compare FrameTypes before sending state or deltas. A matching TypeID remains necessary but is not sufficient: applications still own authentication, authorization, limits, and decoder selection.

Example
package main

import (
	"fmt"

	"github.com/DarkInno/crdt"
)

func main() {
	stable := crdt.ProtocolPolicy{}
	compatibility := crdt.ProtocolPolicy{AllowExperimental: true}

	fmt.Println(stable.SupportsFrame(crdt.TypeIDRGAState))
	fmt.Println(compatibility.SupportsFrame(crdt.TypeIDRGAState))
}
Output:
true
true

func (ProtocolPolicy) FrameTypes

func (p ProtocolPolicy) FrameTypes() []FrameType

FrameTypes returns a copy of every protocol enabled by p. The returned slice is stable in type-ID order and safe for callers to advertise or modify.

func (ProtocolPolicy) SupportsFrame

func (p ProtocolPolicy) SupportsFrame(typeID uint64) bool

SupportsFrame reports whether typeID is both implemented by this module and enabled by p. It applies to either a state or delta frame type ID.

type ReplicationProfile added in v1.0.30

type ReplicationProfile struct {
	// ID is the stable, case-sensitive profile identifier.
	ID string
	// Title is a short human-facing name for the underlying CRDT.
	Title string
	// Summary describes the merge rule in product language.
	Summary string
	// ConflictRule states the deterministic outcome of concurrent updates.
	ConflictRule string
	// RecommendedFor lists product facts that fit this merge rule.
	RecommendedFor []string
	// NotFor lists product decisions that must stay authoritative.
	NotFor []string
	// HostRequirements lists protocol-specific work that remains with the host.
	HostRequirements []string
	// RequiresCodecID reports whether the selected frame contract carries an
	// application-defined deterministic element codec ID.
	RequiresCodecID bool
	// FrameType is the canonical state/delta pair and semantics version.
	FrameType FrameType
}

ReplicationProfile is a curated, machine-readable starting point for one concrete CRDT protocol. It helps an application choose a merge rule from a business fact before it builds a manifest; it is not a security policy or a capacity configuration.

The profile ID, frame type, and semantics version are stable integration inputs. Applications must still authenticate the exact manifest, authorize every sender, choose decoder and retention limits, and persist the recovery state described by HostRequirements.

func ReplicationProfileFor added in v1.0.30

func ReplicationProfileFor(id string) (ReplicationProfile, bool)

ReplicationProfileFor returns the profile named by the exact stable ID. IDs are intentionally not normalized: a configuration typo must not choose a different merge rule.

func ReplicationProfiles added in v1.0.30

func ReplicationProfiles() []ReplicationProfile

ReplicationProfiles returns defensive copies of every curated profile in a stable learning order. The returned values are metadata only: changing them cannot enable a frame type or alter protocol admission.

type StateReporter added in v1.0.5

type StateReporter interface {
	State() StateSnapshot
}

StateReporter exposes an immutable CRDT diagnostic summary.

It intentionally excludes application values, mutation tags, clock state, and framed bytes. Use it for observability only, never to persist or replicate a CRDT.

type StateSnapshot

type StateSnapshot struct {
	Type           string `json:"type"`
	ReplicaID      string `json:"replica_id"`
	ElementCount   int    `json:"element_count"`
	TombstoneCount int    `json:"tombstone_count"`
}

StateSnapshot is an immutable summary of a CRDT state for diagnostics and observability. It never exposes mutable internal data.

type Tag

type Tag struct {
	ReplicaID string
	WallTime  uint64
	Logical   uint64
}

Tag uniquely identifies a CRDT mutation. WallTime, Logical, and ReplicaID are compared in that order. ReplicaID must be globally unique among live logical replicas; callers that reuse an ID across restarts must persist the last emitted clock state.

func (Tag) Compare

func (t Tag) Compare(other Tag) int

Compare returns -1, 0, or 1 according to the canonical ordering of tags.

func (Tag) Valid

func (t Tag) Valid() bool

Valid reports whether t is safe to use as a CRDT mutation identifier.

Directories

Path Synopsis
Package attachment replicates bounded references to externally stored images, audio, video, and arbitrary data.
Package attachment replicates bounded references to externally stored images, audio, video, and arbitrary data.
Package awareness implements bounded, ephemeral presence state for a collaboration group.
Package awareness implements bounded, ephemeral presence state for a collaboration group.
Package clock implements a hybrid logical clock for CRDT mutation tags.
Package clock implements a hybrid logical clock for CRDT mutation tags.
cmd
crdt-analyze command
Command crdt-analyze reports bounded, transport-safe metadata about one canonical CRDT frame.
Command crdt-analyze reports bounded, transport-safe metadata about one canonical CRDT frame.
crdt-benchmark-check command
Command crdt-benchmark-check compares controlled Go benchmark samples.
Command crdt-benchmark-check compares controlled Go benchmark samples.
crdt-cluster-sim command
Command crdt-cluster-sim exercises run-v2 RGA synchronization over real HTTP links.
Command crdt-cluster-sim exercises run-v2 RGA synchronization over real HTTP links.
crdt-compare command
Command crdt-compare produces the DarkInno side of the reproducible cross-library text-sync comparison.
Command crdt-compare produces the DarkInno side of the reproducible cross-library text-sync comparison.
crdt-merkle-sync command
Command crdt-merkle-sync repairs bounded G-Counter state directories over authenticated HTTP by reconciling their Merkle roots.
Command crdt-merkle-sync repairs bounded G-Counter state directories over authenticated HTTP by reconciling their Merkle roots.
crdt-profile command
Command crdt-profile lists the library's curated CRDT selection profiles.
Command crdt-profile lists the library's curated CRDT selection profiles.
crdt-rga-wasm command
crdt-rga-wasm exposes the bounded RGA browser runtime through one small syscall/js surface.
crdt-rga-wasm exposes the bounded RGA browser runtime through one small syscall/js surface.
crdt-sync-probe command
Command crdt-sync-probe exercises CRDT delta delivery over real HTTP links.
Command crdt-sync-probe exercises CRDT delta delivery over real HTTP links.
Package config provides explicit, layered configuration lookup for host applications.
Package config provides explicit, layered configuration lookup for host applications.
Package counter implements counter CRDT primitives.
Package counter implements counter CRDT primitives.
Package delta provides bounded batching and coalescing for encoded CRDT deltas.
Package delta provides bounded batching and coalescing for encoded CRDT deltas.
Package document provides bounded, document-level routing for MoveRGA sequences.
Package document provides bounded, document-level routing for MoveRGA sequences.
Package documenttree implements a bounded, framed, fully nested document-tree CRDT.
Package documenttree implements a bounded, framed, fully nested document-tree CRDT.
durable module
Package encoding provides canonical, bounded binary frames for CRDT state.
Package encoding provides canonical, bounded binary frames for CRDT state.
Package history provides bounded, local undo/redo and version-history metadata for CRDT applications.
Package history provides bounded, local undo/redo and version-history metadata for CRDT applications.
internal
cmd/typeidgen command
Command typeidgen generates the language-specific CRDT TypeID registries from docs/protocol/type-ids.json.
Command typeidgen generates the language-specific CRDT TypeID registries from docs/protocol/type-ids.json.
codecguard
Package codecguard contains the panic boundary for application-provided element codecs.
Package codecguard contains the panic boundary for application-provided element codecs.
wasm
Package wasm contains host-neutral state used by the browser-facing Wasm command.
Package wasm contains host-neutral state used by the browser-facing Wasm command.
Package list implements a generic, ordered Replicated Growable Array (RGA).
Package list implements a generic, ordered Replicated Growable Array (RGA).
Package lww implements last-write-wins CRDT collections.
Package lww implements last-write-wins CRDT collections.
Package membership provides a transport-independent, signed membership protocol reference for CRDT replication groups.
Package membership provides a transport-independent, signed membership protocol reference for CRDT replication groups.
Package merkle provides deterministic state digests for anti-entropy.
Package merkle provides deterministic state digests for anti-entropy.
Package observe connects a CRDT to an application-owned reactive view.
Package observe connects a CRDT to an application-owned reactive view.
providers
sqlite module
Package register implements state-based register CRDTs.
Package register implements state-based register CRDTs.
Package replica defines the transport-independent boundary around one framed CRDT replication group.
Package replica defines the transport-independent boundary around one framed CRDT replication group.
Package richtext implements bounded, inline formatted collaborative text.
Package richtext implements bounded, inline formatted collaborative text.
Package set implements set CRDT primitives.
Package set implements set CRDT primitives.
Package shared provides a small, Yjs-style document facade over the bounded document-tree-v2 CRDT.
Package shared provides a small, Yjs-style document facade over the bounded document-tree-v2 CRDT.
Package snapshot defines immutable, versioned CRDT state snapshots and bounded recovery plans.
Package snapshot defines immutable, versioned CRDT state snapshots and bounded recovery plans.
telemetry module
Package text implements a state-based Replicated Growable Array (RGA).
Package text implements a state-based Replicated Growable Array (RGA).
Package tombstonegc coordinates tombstone collection.
Package tombstonegc coordinates tombstone collection.
Package tree implements an observed-remove rooted tree CRDT.
Package tree implements an observed-remove rooted tree CRDT.
Package xml provides a bounded, deterministic XML fragment CRDT.
Package xml provides a bounded, deterministic XML fragment CRDT.

Jump to

Keyboard shortcuts

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