feat(cast): hand-rolled Cast CastMessage codec - #74
Open
susamn wants to merge 1 commit into
Open
Conversation
internal/cast/castproto encodes/decodes the Google Cast channel protocol's CastMessage in protobuf wire format directly, plus the 4-byte length-prefixed framing. Deviation from the plan (which called for google.golang.org/protobuf + a generated binding): CastMessage has six scalar fields we ever touch and a frozen protocol version, so a hand-written codec avoids a large module and a codegen step for the project -- matching the "keep dependencies minimal" goal. Round-trip and known-byte tests included; unknown fields are skipped so a protocol extension won't break decoding. No new dependencies. Not wired into a provider yet. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JBJdG8Qenand5i16WT6BHG
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #73.
internal/cast/castprotoencodes/decodes the Cast channel protocol'sCastMessagein protobuf wire format directly, plus 4-byte length-prefixed framing.Deviation from the plan (which called for
google.golang.org/protobuf+ a generated binding):CastMessagehas six scalar fields and a frozen protocol version, so a hand-written codec avoids a large module + codegen step. Unknown fields are skipped so a protocol extension won't break decoding.Round-trip + known-byte tests. No new dependencies. Not wired to a provider yet.