The Go client opens a framed TCP session to the control plane, performs the Noise NNpsk0 handshake, and exchanges Cap’n Proto control messages. It mirrors the verb set used by the other SDKs and returns raw JSON strings so you can hydrate your own structs.Documentation Index
Fetch the complete documentation index at: https://docs.eventdbx.com/llms.txt
Use this file to discover all available pages before exploring further.
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
| Variable | Default | Description |
|---|---|---|
EVENTDBX_HOST | 127.0.0.1 | Hostname or IP address of the control socket. |
EVENTDBX_PORT | 6363 | TCP port for the control plane. |
EVENTDBX_TOKEN | empty | Control token sent during the handshake; required. |
EVENTDBX_TENANT_ID | default | Tenant identifier included in the hello message. |
EVENTDBX_NO_NOISE | unset/false | When set to 1, disables Noise for plaintext lab sockets. |
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.