mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
API-shape changes flagged as 'hard to reverse after v1' by the architect reviewer. Acceptable to do now while no external code imports the package; would be breaking later. Surface tightening ------------------ * Decode unexported to decode. The Stream is the only intended caller; exposing the helper invited future API drift. Same-package tests still reach it. * TopicFilter renamed to RawTopicFilter to signal that the value is fed verbatim into the SOAP envelope and is the 'advanced escape hatch', not the supported routing surface. Callers should normally leave it empty and rely on Classify. Options zero-value policy clarified ----------------------------------- * Field godoc on every numeric option now explicitly states 'zero means default' so the policy is local, not buried in withDefaults(). * New DisableReconnect bool — addresses the ReconnectAfterFailures=0-as-disable footgun the API reviewer flagged. Reader can no longer confuse 'unset, fallback to default' with 'opt out of reconnect'. * BufferSize semantics extended: zero -> default (16), negative -> unbuffered (0), positive -> explicit size. Lets callers ask for back-pressure-only channels. Default tuning -------------- * MessageLimit default raised from 10 to 32. Busy AXIS cameras with several configured inputs / analytics rules can burst beyond 10 per pull; the lower cap meant up to one PullTimeout of added latency for the queued overflow without saving anything meaningful. 32 covers observed bursts with no real overhead on quiet pulls. Caller interface ---------------- * Doc comment now states the goroutine-safety contract Stream depends on (pull loop and renew loop call from separate goroutines). *onvif.Device satisfies it via http.Client. Package documentation --------------------- * doc.go rewritten as a real godoc landing page: usage snippet, invariants (channel close, Close idempotency, NewStream does I/O, buffer semantics), reconnect behaviour and AfterReconnect, and a pointer to topics.go for the classifier table. Replaces the earlier stub that referenced unimplemented identifiers.