Skip to content

aholstenson/loro-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loro-go

This repository contains Loro CRDT bindings for Go. Contains pre-built binaries for MacOS (ARM64, AMD64) and Linux (ARM64, AMD64).

⚠️ There is currently very little extra plumbing to make the bindings easier to use. I'm updating it as I need it.

Usage

go get github.com/aholstenson/loro-go

When building your binary you will likely want statically linking to avoid a dependency on libgcc:

go build -ldflags '-linkmode external -extldflags "-static"'

Examples

Getting started

doc := loro.NewLoroDoc()

loroMap := doc.GetMap(loro.AsContainerID("test"))
loroMap.Insert("test", loro.AsStringValue("test"))

Exporting updates

updates, err := doc.ExportUpdates(loro.NewVersionVector())

Importing updates

status, err := doc.Import(updates)

About

Go bindings for Loro CRDT

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages