clients/go: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.4) #108

Merged
dohertj2 merged 1 commits from track-e4-go-alarm-sdk into main 2026-04-30 16:57:19 -04:00
Owner

Summary

Ninth PR of the alarms-over-gateway epic (docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface on the Go SDK. Depends on PR E.1 (#105, merged).

  • Client.AcknowledgeAlarm — context-aware unary call routed through the existing callContext helper (default 30s timeout). Failures wrap into *GatewayError; protocol-status non-OK promotes to typed protocol errors via EnsureProtocolSuccess.
  • Client.QueryActiveAlarms — context-streaming wrapper around the generated MxAccessGateway_QueryActiveAlarmsClient. Caller drives the stream via Recv(); cancelling ctx releases it.
  • types.go re-exports the four new generated types (AcknowledgeAlarmRequest/Reply, QueryActiveAlarmsRequest, ActiveAlarmSnapshot) plus the AlarmTransitionKind / AlarmConditionState enums and the QueryActiveAlarmsClient stream alias.
  • version.go bumps GatewayProtocolVersion 1 → 3 to match the .NET contract; the const was previously stale and the bump fixes the pre-existing TestOpenSessionFixtureProtocolVersions failure that was masked because the fixture had not been regenerated until A.1.

Test plan

  • 4 new tests in alarms_test.go — request shape + auth metadata, nil-request rejection, Unauthenticated mapping, snapshot streaming over bufconn, filter-prefix passthrough
  • All Go test suites green: cmd/mxgw-go + mxgateway
## Summary Ninth PR of the **alarms-over-gateway** epic (docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface on the Go SDK. Depends on PR E.1 (#105, merged). - `Client.AcknowledgeAlarm` — context-aware unary call routed through the existing `callContext` helper (default 30s timeout). Failures wrap into `*GatewayError`; protocol-status non-OK promotes to typed protocol errors via `EnsureProtocolSuccess`. - `Client.QueryActiveAlarms` — context-streaming wrapper around the generated `MxAccessGateway_QueryActiveAlarmsClient`. Caller drives the stream via `Recv()`; cancelling ctx releases it. - `types.go` re-exports the four new generated types (`AcknowledgeAlarmRequest/Reply`, `QueryActiveAlarmsRequest`, `ActiveAlarmSnapshot`) plus the `AlarmTransitionKind` / `AlarmConditionState` enums and the `QueryActiveAlarmsClient` stream alias. - `version.go` bumps `GatewayProtocolVersion` 1 → 3 to match the .NET contract; the const was previously stale and the bump fixes the pre-existing `TestOpenSessionFixtureProtocolVersions` failure that was masked because the fixture had not been regenerated until A.1. ## Test plan - [x] 4 new tests in `alarms_test.go` — request shape + auth metadata, nil-request rejection, Unauthenticated mapping, snapshot streaming over bufconn, filter-prefix passthrough - [x] All Go test suites green: `cmd/mxgw-go` + `mxgateway`
dohertj2 added 1 commit 2026-04-30 16:57:17 -04:00
Ninth PR of the alarms-over-gateway epic
(docs/plans/alarms-over-gateway.md). Mirrors PR E.2's .NET surface
on the Go SDK. Depends on PR E.1 (regen, merged).

- Client.AcknowledgeAlarm — context-aware unary call routed through
  the existing callContext helper (default 30s timeout). Failures
  wrap into *GatewayError; protocol-status non-OK promotes to typed
  protocol errors via EnsureProtocolSuccess.
- Client.QueryActiveAlarms — context-streaming wrapper around the
  generated MxAccessGateway_QueryActiveAlarmsClient. Caller drives
  the stream via Recv(); cancelling ctx releases it.
- types.go re-exports the four new generated types
  (AcknowledgeAlarmRequest/Reply, QueryActiveAlarmsRequest,
  ActiveAlarmSnapshot) plus the AlarmTransitionKind /
  AlarmConditionState enums and the
  QueryActiveAlarmsClient stream alias.
- version.go bumps GatewayProtocolVersion 1 → 3 to match the .NET
  contract; the const was previously stale and the bump fixes the
  pre-existing TestOpenSessionFixtureProtocolVersions failure that
  was masked because the fixture had not been regenerated until A.1.

Tests:
- 4 new tests in alarms_test.go — request shape + auth metadata,
  nil-request rejection, Unauthenticated mapping, snapshot
  streaming over bufconn, filter-prefix passthrough.
- All Go test suites green: cmd/mxgw-go + mxgateway.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
dohertj2 merged commit 55470e3e09 into main 2026-04-30 16:57:19 -04:00
dohertj2 deleted branch track-e4-go-alarm-sdk 2026-04-30 16:57:19 -04:00
Sign in to join this conversation.