Go client¶
The official Go client lives in clients/go/synapse. It is a small read-only
client for ops tools and CI services that need to inspect a running SYNAPSE
dashboard snapshot.
It reads HTTP JSON surfaces. It does not implement the WebSocket mutation protocol for claims, chat, board writes, release receipts, or presence. Use the Python CLI/client or MCP/A2A adapters for those flows.
Install¶
Use the module directly from this repository:
cd clients/go/synapse
go test ./...
Downstream tools can import:
import synapse "github.com/anulum/synapse-channel/clients/go/synapse"
Read a dashboard snapshot¶
Start the read-only dashboard beside a hub:
synapse dashboard --port 8765
For an intentionally exposed dashboard bind, require dashboard-local bearer authentication:
synapse dashboard \
--host 0.0.0.0 \
--allow-non-loopback \
--dashboard-token "$DASHBOARD_TOKEN"
Then read /snapshot.json:
client, err := synapse.NewClient("http://127.0.0.1:8765")
if err != nil {
return err
}
snapshot, err := client.DashboardSnapshot(ctx)
if err != nil {
return err
}
for _, agent := range snapshot.OnlineAgents {
fmt.Println(agent)
}
DashboardSnapshot decodes the stable dashboard keys:
OnlineAgentsStateBoardManifestFleet
Use GetJSON for another local HTTP JSON endpoint:
var payload map[string]any
err := client.GetJSON(ctx, "/snapshot.json", &payload)
Authentication¶
Pass WithBearerToken when the HTTP surface requires a bearer token:
client, err := synapse.NewClient(
"http://127.0.0.1:8765",
synapse.WithBearerToken(os.Getenv("DASHBOARD_TOKEN")),
)
The dashboard requires this header when started with --dashboard-token or when
Synapse generates a startup token for a non-loopback bind. The client sends
Authorization: Bearer <token> and returns a StatusError when the endpoint
rejects the request.
Boundary¶
This client is intentionally dependency-free and read-only. It supports operational inspection for CI jobs, status pages, and local tooling. It does not claim work, release tasks, mutate the blackboard, or send messages.