Skip to content

V18 refacto - #6

Merged
Michelprogram merged 3 commits into
v18from
v18-refacto
Apr 24, 2026
Merged

V18 refacto#6
Michelprogram merged 3 commits into
v18from
v18-refacto

Conversation

@Michelprogram

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors protocol-specific decoding to move decoder wiring out of reader.Reader and into internal/context.Context, while making byte-order explicit at call sites and standardizing reader error values.

Changes:

  • Introduces context.Decoders (parameter parser + reliable header parameter counter) and threads it through context.NewContext / parser constructors.
  • Simplifies reader.NewReader (no options) and updates numeric read APIs to take an explicit binary.ByteOrder.
  • Updates v16/v18 parameter parsing and multiple command/session parsing call sites + tests to match the new context/reader APIs.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
parser.go Switches parser constructors to context.NewContext + context.Decoders.
internal/context/context.go Extends Context to include Decoders; updates NewContext signature.
internal/context/decoders.go Adds decoder interfaces + Decoders struct for protocol wiring.
internal/reader/reader.go Removes options from Reader; makes endian explicit on numeric reads; introduces shared error vars.
internal/reader/reader_test.go Updates reader tests for new NewReader + endian-explicit APIs.
internal/errors/erros.go Adds shared reader error variables.
internal/session/session.go Updates session header parsing to pass explicit endian.
internal/session/session_test.go Updates tests to new context.NewContext signature + decoder wiring.
internal/command/command.go Updates command header parsing to pass explicit endian.
internal/command/command_test.go Updates command tests for new reader/context construction.
internal/command/reliable/reliable.go Moves parameter parsing to ctx.Decoders; adjusts header parsing reads.
internal/command/reliable/reliable_test.go Updates reliable tests to provide context.Decoders.
internal/command/reliable/fragment.go Updates fragment metadata reads for endian-explicit methods; renames ReadRest usage.
internal/command/connect/connect.go Updates connect parsing to pass explicit endian.
internal/command/acknowledge/acknowledge.go Updates acknowledge parsing to pass explicit endian.
internal/hooks/hooks_test.go Updates hook tests to new Reader + Context.Decoders wiring.
internal/parameters/v16/*.go Updates v16 decoding to pass explicit big-endian reads; updates interfaces to context.*.
internal/parameters/v16/*_test.go Updates v16 tests to new NewReader signature.
internal/parameters/v18/*.go Updates v18 decoding to new reader API and context.* interfaces; adjusts endian usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread internal/context/decoders.go Outdated
Comment thread internal/errors/erros.go Outdated
Comment thread internal/reader/reader.go
Comment thread internal/reader/reader.go
Comment thread internal/command/reliable/reliable.go Outdated
Comment thread internal/command/reliable/reliable.go
Comment thread internal/parameters/v18/parameters.go
Comment thread internal/parameters/v18/arrays.go
@Michelprogram
Michelprogram merged commit 710dabc into v18 Apr 24, 2026
6 of 8 checks passed
@Michelprogram
Michelprogram deleted the v18-refacto branch April 24, 2026 19:42
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.

2 participants