This repository contains Loro CRDT bindings for Go. Contains pre-built binaries for MacOS (ARM64, AMD64) and Linux (ARM64, AMD64).
Current Loro version: 1.10.3
./scripts/updateLoro.sh 1.x.xYou can get the version number from the loro-ffi tags page.
This updates the loro-ffi submodule, loro-go/Cargo.toml, and the lockfile. Open a PR with the changes and CI will build the libraries and commit them after merge.
go get github.com/aholstenson/loro-goWhen building your binary you will likely want statically linking to avoid a dependency on libgcc:
go build -ldflags '-linkmode external -extldflags "-static"'doc := loro.NewLoroDoc()
loroMap := doc.GetMap(loro.AsContainerID("test"))
loroMap.Insert("test", loro.AsStringValue("test"))updates, err := doc.ExportUpdates(loro.NewVersionVector())status, err := doc.Import(updates)