Skip to content

refactor(scan)!: modernize channel and generator APIs - #152

Merged
v-byte-cpu merged 1 commit into
masterfrom
refactor/modernize-scan-channel-apis
Aug 9, 2026
Merged

refactor(scan)!: modernize channel and generator APIs#152
v-byte-cpu merged 1 commit into
masterfrom
refactor/modernize-scan-channel-apis

Conversation

@v-byte-cpu

Copy link
Copy Markdown
Owner

Why

The scan pipeline still used pre-generics abstractions, duplicated channel coordination logic,
and contained cancellation and error-propagation edge cases.

What Changed

  • replace getter-based generator values with GeneratorResult[T]
  • add generic channel merge and context-aware send helpers
  • rename GenericEngine to ScanEngine
  • use typed completion channels
  • fix cancellation, live-rescan error propagation, and stale JSONL state
  • reduce cognitive complexity in packet sender and generator workers
  • move test assertions out of worker goroutines
  • regenerate mocks and modernize affected tests
  • remove the obsolete Go Report Card badge

Validation

  • go test -race ./... -count=1
  • go build ./...
  • golangci-lint run --verbose
  • formatting, diff, and generation drift checks

Replace legacy getter-based results with GeneratorResult[T] and
consolidate channel operations using generic helpers.

Improve cancellation handling, propagate live-rescan errors, prevent
stale JSONL values, and update generated mocks and tests.

BREAKING CHANGE: Rename GenericEngine to ScanEngine, change completion
channels to <-chan struct{}, replace PortGetter and IPGetter APIs with
GeneratorResult[T], and remove MergeBufferDataChan.
@v-byte-cpu
v-byte-cpu merged commit 6d4e193 into master Aug 9, 2026
6 checks passed
@v-byte-cpu
v-byte-cpu deleted the refactor/modernize-scan-channel-apis branch August 9, 2026 18:26
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