Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

SLIM Go Bindings - Examples

This directory contains Go examples demonstrating SLIM's messaging capabilities.

Prerequisites

Before running any examples, build the Rust library and generate Go bindings:

cd data-plane/bindings/go
task rust-build    # Build Rust core library (release mode)
task generate      # Generate Go bindings from compiled library

Examples

1. Point-to-Point Example

Demonstrates 1:1 messaging between two peers with request/reply pattern.

Terminal 1 - Server:

task example:server

Terminal 2 - Alice (Receiver):

task example:p2p:alice

Terminal 3 - Bob (Sender):

task example:p2p:bob

2. Group Example

Demonstrates group messaging with moderator-participant pattern and concurrent message handling.

Terminal 1 - Server:

task example:server

Terminal 2 - Moderator:

task example:group:moderator

Terminal 3 - Alice (Participant):

task example:group:participant:alice

Terminal 4 - Bob (Participant):

task example:group:participant:bob

Available Tasks

View all available tasks:

task help

Example Structure

examples/
├── common/          # Shared utilities (ID parsing)
├── point_to_point/  # 1:1 messaging
└── group/           # Group messaging

Customizing Examples

All examples support custom parameters via CLI_ARGS:

# Custom point-to-point IDs
task example:p2p:bob CLI_ARGS="--local=org/sender/app --remote=org/receiver/app"

# Custom group channel
task example:group:moderator CLI_ARGS="--remote=org/company/meeting"

# Custom server endpoint
task example:server CLI_ARGS="--endpoint=http://0.0.0.0:46357"

Troubleshooting

"library not found" errors: Run task rust-build first
"undefined symbols" errors: Run task generate to regenerate bindings
Connection failures: Ensure the server is running with task example:server