cabi

command
v1.10.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package main exports lux/zapdb functions as a C shared library.

Build:

CGO_ENABLED=1 go build -buildmode=c-shared -o dist/libzapdb.so ./bindings/cabi/
CGO_ENABLED=1 go build -buildmode=c-shared -o dist/libzapdb.dylib ./bindings/cabi/  # macOS
install_name_tool -id @rpath/libzapdb.dylib dist/libzapdb.dylib                     # macOS rpath

This produces libzapdb.{so,dylib,dll} + libzapdb.h which Rust (FFI), Python (ctypes), and TypeScript (N-API) can bind to.

All stateful Go objects (DB, Txn) are stored behind opaque uint64 handles. A global handle map prevents GC collection.

Jump to

Keyboard shortcuts

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