Skip to content

api: unexport Stream fields, add Id() accessor#588

Merged
oleg-jukovec merged 1 commit into
masterfrom
bigbes/gh-471-unexport-stream-fields
May 15, 2026
Merged

api: unexport Stream fields, add Id() accessor#588
oleg-jukovec merged 1 commit into
masterfrom
bigbes/gh-471-unexport-stream-fields

Conversation

@bigbes
Copy link
Copy Markdown
Collaborator

@bigbes bigbes commented May 5, 2026

  • Unexports Stream.Id and Stream.Conn (v3 breaking change) to enforce encapsulation and prevent unsafe direct mutation like stream.Conn = nil.
  • Adds Stream.Id() uint64 accessor; the underlying connection is no longer reachable from outside the package.

Closes #471

Comment thread export_test.go Outdated
Comment thread stream.go Outdated
Make Stream.Id and Stream.Conn unexported, turning Stream into an
opaque handle. This enforces encapsulation and prevents unsafe direct
mutation (e.g. stream.Conn = nil). Neither the stream identifier nor
the underlying connection is reachable from outside the package —
callers should hold their own *Connection reference if they need it.

- Rename Stream.Id/Stream.Conn to Stream.id/Stream.conn.
- Drop TestStream_IdValues: it only existed to push synthetic stream
  ids through a Stream; MP_UINT encoding is covered elsewhere.
- Document the breaking change in CHANGELOG.md and MIGRATION.md.

Closes #471
@bigbes bigbes force-pushed the bigbes/gh-471-unexport-stream-fields branch from cd8ab3d to 2e664eb Compare May 12, 2026 22:55
@bigbes bigbes requested a review from oleg-jukovec May 12, 2026 22:55
@oleg-jukovec oleg-jukovec merged commit f8937c2 into master May 15, 2026
27 checks passed
@oleg-jukovec oleg-jukovec deleted the bigbes/gh-471-unexport-stream-fields branch May 15, 2026 12:14
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.

v3: refactor Stream struct

3 participants