Skip to content

moqt: split session.go by concern#19

Merged
floatdrop merged 1 commit into
draft-18from
moqt-restructure
Jun 26, 2026
Merged

moqt: split session.go by concern#19
floatdrop merged 1 commit into
draft-18from
moqt-restructure

Conversation

@floatdrop

@floatdrop floatdrop commented Jun 26, 2026

Copy link
Copy Markdown
Owner

Intra-package tidying of pkg/moqt/session/ for discoverability. No API, behavior, or layering changes — purely splitting one oversized file.

What changed

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):

new file holds
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).

Scope notes

  • pkg/moqt is already cleanly layered (wire → message → session, siblings track/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 with datastream_out.go), not a grab-bag.

Verification

go build ./..., full go test ./..., go test -race ./pkg/moqt/session/..., golines/gofmt clean, modernize (-errorsastype) clean.

🤖 Generated with Claude Code

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>
@floatdrop floatdrop changed the title moqt: split session.go by concern + add package doc-maps moqt: split session.go by concern Jun 26, 2026
@floatdrop floatdrop merged commit d452d82 into draft-18 Jun 26, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant