mirror of
https://github.com/logos-messaging/sds-go-bindings.git
synced 2026-07-24 00:43:17 +00:00
nim-sds built on nim-ffi 0.2.0 exports a new C ABI (snake_case symbols,
CBOR-marshalled requests/responses, named event-listener registry),
which the old PascalCase callback-based bindings could not link against
(undefined reference to SdsWrapOutgoingMessage / SdsUnwrapReceivedMessage).
Rewrite the cgo layer to the new ABI while keeping the Go-facing API
identical so consumers (status-go reliability layer) need no changes:
- sds_schema.go: CBOR structs matching nim-sds library/libsds.nim. The
.ffi. macro wraps each proc's non-ctx params in a generated request
object keyed by the param name, so requests are nested ({req:{...}});
no-extra-param procs take {_placeholder: uint8}.
- sds.go: snake_case wrappers; callback copies the callback-scoped CBOR
buffer before returning to avoid a use-after-free.
- sds_common.go: event path decodes the CBOR {eventType, payload}
envelope instead of JSON.
- NewReliabilityManager passes an empty participantId (plain SDS, SDS-R
repair disabled) to preserve pre-nim-ffi behavior.
Validated: full binding test suite (incl. event callbacks) passes
against a libsds built from nim-ffi 0.2.0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
SDS Go Bindings
This repository provides Go bindings for the SDS library, enabling seamless integration with Go projects.
Installation
To build the required dependencies for this module, the make command needs to be executed. If you are integrating this module into another project via go get, ensure that you navigate to the sds-go-bindings/sds directory and run make.
Steps to Install
Follow these steps to install and set up the module:
- Retrieve the module using
go get:go get -u github.com/waku-org/sds-go-bindings - Navigate to the module's directory:
cd $(go list -m -f '{{.Dir}}' github.com/waku-org/sds-go-bindings) - Prepare third_party directory which will clone
nim-sdssudo mkdir third_party sudo chown $USER third_party - Build the dependencies:
make -C sds
Now the module is ready for use in your project.
Note
In order to easily build the libsds library on demand, it is recommended to add the following target in your project's Makefile:
LIBSDS_DEP_PATH=$(shell go list -m -f '{{.Dir}}' github.com/waku-org/sds-go-bindings)
buildlib:
cd $(LIBSDS_DEP_PATH) &&\
sudo mkdir -p third_party &&\
sudo chown $(USER) third_party &&\
make -C sds
Description
Languages
Go
96.1%
Makefile
3.9%