feat: add capnp

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2026-02-27 12:15:35 +01:00
parent 3162971c89
commit 749ae245c7
115 changed files with 16596 additions and 31 deletions

45
scripts/grpc.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Helper script for testing SQ gRPC endpoints with grpcurl.
# Usage: ./scripts/grpc.sh <command> [args...]
#
# Commands:
# status [addr] - Get node status
# publish <topic> <msg> - Publish a message
# subscribe <topic> - Subscribe to a topic
# topics - List topics
set -euo pipefail
ADDR="${SQ_ADDR:-127.0.0.1:6060}"
case "${1:-help}" in
status)
addr="${2:-$ADDR}"
grpcurl -plaintext "$addr" sq.v1.StatusService/Status
;;
publish)
topic="${2:?topic required}"
msg="${3:?message required}"
grpcurl -plaintext -d "{\"topic\": \"$topic\", \"messages\": [{\"value\": \"$(echo -n "$msg" | base64)\"}]}" \
"$ADDR" sq.v1.DataPlaneService/Publish
;;
subscribe)
topic="${2:?topic required}"
grpcurl -plaintext -d "{\"topic\": \"$topic\", \"partition\": 0}" \
"$ADDR" sq.v1.DataPlaneService/Subscribe
;;
topics)
grpcurl -plaintext "$ADDR" sq.v1.ControlPlaneService/ListTopics
;;
help|*)
echo "Usage: $0 <command> [args...]"
echo ""
echo "Commands:"
echo " status [addr] - Get node status"
echo " publish <topic> <msg> - Publish a message"
echo " subscribe <topic> - Subscribe to a topic"
echo " topics - List topics"
echo ""
echo "Environment: SQ_ADDR (default: 127.0.0.1:6060)"
;;
esac