Client SDKs
Angzarr provides client libraries for multiple languages, enabling polyglot teams to build event-sourced applications using their preferred language.
Supported Languages
| Language | Package | Status |
|---|---|---|
| Rust | angzarr-client | Production |
| Go | github.com/benjaminabbitt/angzarr/client/go | Production |
| Python | angzarr-client | Production |
| Java | dev.angzarr:angzarr-client | Production |
| C# | Angzarr.Client | Production |
| C++ | angzarr-client | Production |
Installation
- Rust
- Go
- Python
- Java
- C#
- C++
[dependencies]
angzarr-client = "0.1"
go get github.com/benjaminabbitt/angzarr/client/go
pip install angzarr-client
<dependency>
<groupId>dev.angzarr</groupId>
<artifactId>angzarr-client</artifactId>
<version>0.1.0</version>
</dependency>
dotnet add package Angzarr.Client
include(FetchContent)
FetchContent_Declare(
angzarr-client
GIT_REPOSITORY https://github.com/benjaminabbitt/angzarr.git
GIT_TAG main
SOURCE_SUBDIR client/cpp
)
FetchContent_MakeAvailable(angzarr-client)
target_link_libraries(your_target PRIVATE angzarr-client)
Quick Start
Connect to an aggregate coordinator and send a command:
- Rust
- Go
- Python
- Java
- C#
- C++
use angzarr_client::DomainClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = DomainClient::connect("http://localhost:1310").await?;
let response = client.aggregate.handle(command).await?;
Ok(())
}
client, err := angzarr.NewAggregateClient("localhost:1310")
if err != nil {
log.Fatal(err)
}
defer client.Close()
response, err := client.Handle(ctx, command)
from angzarr_client import DomainClient
client = DomainClient.connect("localhost:1310")
response = client.aggregate.handle(command)
try (DomainClient client = DomainClient.connect("localhost:1310")) {
CommandResponse response = client.execute(command);
}
using var client = DomainClient.Connect("http://localhost:1310");
var response = client.Execute(command);
auto client = angzarr::DomainClient::connect("localhost:1310");
auto response = client->execute(command);
Client Types
All SDKs provide the same set of client types:
| Client | Purpose |
|---|---|
QueryClient | Query events from aggregates |
AggregateClient | Send commands to aggregates |
SpeculativeClient | Dry-run commands without persistence |
DomainClient | Combined query + aggregate for a domain |
Client | Full client with all capabilities |
SDK Contents
- Clients — Client types and connection patterns
- Builders — Fluent CommandBuilder and QueryBuilder
- Error Handling — Error types and introspection
- Speculative Execution — What-if scenarios without persistence
Language-Specific Documentation
Each SDK has its own detailed documentation:
| Language | Documentation |
|---|---|
| Rust | /sdk/rust |
| Go | /sdk/go |
| Python | /sdk/python |
| Java | /sdk/java |
| C# | /sdk/csharp |
| C++ | /sdk/cpp |