clients/go: SDK methods for AcknowledgeAlarm + QueryActiveAlarms (PR E.4) #108
Reference in New Issue
Block a user
Delete Branch "track-e4-go-alarm-sdk"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 existingcallContexthelper (default 30s timeout). Failures wrap into*GatewayError; protocol-status non-OK promotes to typed protocol errors viaEnsureProtocolSuccess.Client.QueryActiveAlarms— context-streaming wrapper around the generatedMxAccessGateway_QueryActiveAlarmsClient. Caller drives the stream viaRecv(); cancelling ctx releases it.types.gore-exports the four new generated types (AcknowledgeAlarmRequest/Reply,QueryActiveAlarmsRequest,ActiveAlarmSnapshot) plus theAlarmTransitionKind/AlarmConditionStateenums and theQueryActiveAlarmsClientstream alias.version.gobumpsGatewayProtocolVersion1 → 3 to match the .NET contract; the const was previously stale and the bump fixes the pre-existingTestOpenSessionFixtureProtocolVersionsfailure that was masked because the fixture had not been regenerated until A.1.Test plan
alarms_test.go— request shape + auth metadata, nil-request rejection, Unauthenticated mapping, snapshot streaming over bufconn, filter-prefix passthroughcmd/mxgw-go+mxgateway