-
Notifications
You must be signed in to change notification settings - Fork 5
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
Add capabilty to inject custom fields in requests #246
Conversation
b29c0a5
to
465c56f
Compare
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.
Looks good to me
Codecov Report
@@ Coverage Diff @@
## 2-dev #246 +/- ##
==========================================
+ Coverage 88.86% 88.91% +0.05%
==========================================
Files 244 244
Lines 4463 4466 +3
==========================================
+ Hits 3966 3971 +5
+ Misses 443 441 -2
Partials 54 54
Continue to review full report at Codecov.
|
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.
Good job 👍 Just a few suggestions on API names
And also for the label, it's more an enhancement to me (or even a bugfix) rather than a new feature
types/kuzzle_request.go
Outdated
CustomFields map[string]interface{} `json:"-"` | ||
} | ||
|
||
func (kr *KuzzleRequest) AddCustomField(k string, v interface{}) { |
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.
In our terminology we call these top level query fields "args" because you can then find them in the request.input.args
property.
Maybe a method like AddArg
would be more appropriate
types/kuzzle_request.go
Outdated
Match string `json:"match,omitempty"` | ||
Reset bool `json:"reset,omitempty"` | ||
IncludeTrash bool `json:"includeTrash,omitempty"` | ||
CustomFields map[string]interface{} `json:"-"` |
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.
Same remark as for AddCustomField
, something like CustomArgs
Codecov Report
@@ Coverage Diff @@
## 2-dev #246 +/- ##
==========================================
+ Coverage 88.86% 88.91% +0.05%
==========================================
Files 244 244
Lines 4463 4466 +3
==========================================
+ Hits 3966 3971 +5
+ Misses 443 441 -2
Partials 54 54
Continue to review full report at Codecov.
|
What does this PR do?
Add capabilty to inject custom fields in requests. According to #245
How should this be manually tested?
I used this little program to test this new feature:
But it's very hard to check the WebSocket message so I used Wireshark:
