refactor(diagnostics): encapsulate Client channels with send methods - #8072
Open
bowale01 wants to merge 1 commit into
Open
refactor(diagnostics): encapsulate Client channels with send methods#8072bowale01 wants to merge 1 commit into
bowale01 wants to merge 1 commit into
Conversation
Make the channel fields on diagnostics.Client unexported and expose public methods for sending data, improving encapsulation. Changes: - Made Configs, FallbackCacheMetadata, Diffs channels unexported - Added SendConfig(), SendFallbackCacheMetadata(), SendDiff() methods - Added DumpsIncludeSensitive() getter - Added IsEmpty() to replace zero-value struct comparison - Added Configs(), FallbackCacheMetadataCh(), DiffsCh() receive-only accessors - Added NewClient() constructor - Updated all callers in dataplane and sendconfig packages - Updated test code to use new API Resolves TODO(czeslavo) in internal/diagnostics/types.go
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.
Description
Closes #8071
Resolves the TODO in
internal/diagnostics/types.go:This PR makes the channel fields on
diagnostics.Clientunexported and exposes public methods for controlled access, improving encapsulation.Changes
Configs,FallbackCacheMetadata,Diffschannel fields unexportedSendConfig(),SendFallbackCacheMetadata(),SendDiff()methods for sendingDumpsIncludeSensitive()getterIsEmpty()to replace zero-value struct comparisonConfigs(),FallbackCacheMetadataCh(),DiffsCh()receive-only channel accessorsNewClient()constructorinternal/dataplane/andinternal/dataplane/sendconfig/Type of change
Checklist
go build ./internal/... ./pkg/...passesgo vetpasses on all modified packages