moqt: split session.go by concern#19
Merged
Merged
Conversation
session/session.go was a 620-line grab-bag of five concerns. Split the four separable ones into cohesive sibling files (pure moves within the package; no API, behavior, or layering change): - options.go Option/config + the With* SETUP knobs - control.go control-stream send/recv loops + dispatch - goaway.go §10.4 GOAWAY (send/receive/OnGoaway/draining) - trackalias.go §11.1 inbound/outbound Track Alias bookkeeping session.go now holds just the Session struct, the Client/Server/open SETUP lifecycle, and Close (620 → ~205 lines). Verified: go build ./..., go test ./... (full module), go test -race ./pkg/moqt/session/..., golines/gofmt clean, modernize clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
16a29ee to
24b6351
Compare
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.
Intra-package tidying of
pkg/moqt/session/for discoverability. No API, behavior, or layering changes — purely splitting one oversized file.What changed
session/session.gowas a 620-line grab-bag of five concerns. Split the four separable ones into cohesive sibling files (pure moves within the package):options.goOption/config+ theWith*SETUP knobscontrol.gogoaway.goOnGoaway/draining)trackalias.gosession.gonow holds just theSessionstruct, theClient/Server/openSETUP lifecycle, andClose(620 → ~205 lines).Scope notes
pkg/moqtis already cleanly layered (wire → message → session, siblingstrack/loc/msf/uri) with package docs throughout — so no subpackage extraction and no broader doc changes.datastream_in.go(461 LOC) left intact: cohesive (all inbound stream reading, symmetric withdatastream_out.go), not a grab-bag.Verification
go build ./..., fullgo test ./...,go test -race ./pkg/moqt/session/...,golines/gofmtclean, modernize (-errorsastype) clean.🤖 Generated with Claude Code