-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add CBOR support in EventClient for binary reading #550
Conversation
v2/clients/http/utils/common.go
Outdated
jsonEncodedData, err := json.Marshal(data) | ||
if err != nil { | ||
return nil, errors.NewCommonEdgeX(errors.KindContractInvalid, "failed to encode input data to JSON", err) | ||
func createRequestWithRawData(ctx context.Context, httpMethod string, url string, data interface{}, cborEncoding bool) (*http.Request, errors.EdgeX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use bool because we might have other encoding in the future.
please use string and leverage clients.ContentTypeCBOR / clients.ContentTypeJSON.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, once addressed @cloudxxx8 comment.
Signed-off-by: Chris Hung <chris@iotechsys.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #550 +/- ##
==========================================
- Coverage 56.23% 56.17% -0.07%
==========================================
Files 119 119
Lines 3551 3557 +6
==========================================
+ Hits 1997 1998 +1
- Misses 1357 1361 +4
- Partials 197 198 +1
Continue to review full report at Codecov.
|
Signed-off-by: Chris Hung chris@iotechsys.com
PR Checklist
Please check if your PR fulfills the following requirements:
If your build fails due to your commit message not passing the build checks, please review the guidelines here: https://github.com/edgexfoundry/go-mod-core-contracts/blob/master/.github/Contributing.md.
What is the current behavior?
Issue Number: fix #543
What is the new behavior?
Does this PR introduce a breaking change?
New Imports
Specific Instructions
Are there any specific instructions or things that should be known prior to reviewing?
Other information