Feature highlights
- Create/apply/patch/archive helpers with optional publish targets and metadata.
- Aggregate reads for
get,select,list,events, andverifywith cursors, filters, and sorting. - Snapshot helpers (
create,list,get) plus admin verbs for schemas and tenants. - Noise transport on by default; disable only for trusted lab sockets.
- Retries with backoff and verbose mutation responses by default.
Install
Modules are tagged with semver (
v0.x.y). Pin a specific tag in go.mod for reproducible builds.Connect and configure
NewClient performs the handshake and returns a connected client. Close it during graceful shutdown to release the socket.
Runtime configuration
Write aggregates and events
ApplyOptions.PublishTargets or PatchOptions.PublishTargets to route events to specific plugins.
Read aggregates and events
List and Events return JSON strings plus cursor metadata (HasNextCursor, NextCursor). Feed NextCursor into subsequent calls to resume paging.
Filters, sorting, and pagination
Filters use the same SQL-like grammar as the control plane (field = value AND other_field > 10). Sort fields accept aggregate_type, aggregate_id, created_at, updated_at, and archived. Provide a raw string via Sort ("created_at:desc,aggregate_id:asc") or structured options via SortOptions.
Snapshots and admin helpers
Noise transport
Noise NNpsk0 is enabled by default and derives a PSK from the control token. Disable only for trusted lab sockets by settingEVENTDBX_NO_NOISE=1 or UseNoise: eventdbx.Bool(false) in Config.
Testing
- Unit tests run with
go test ./.... - Integration tests expect a running control plane; set
EVENTDBX_INTEGRATION=1along withEVENTDBX_TOKEN,EVENTDBX_TENANT_ID, and optionallyEVENTDBX_HOST/EVENTDBX_PORTbefore runninggo test.
The Go client methods are synchronous and accept no context parameter; handle timeouts via
Config.ReadTimeout and Config.ConnectTimeout.