Skip to content
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

Use ExtractParameters in handlers #2620

Merged
merged 51 commits into from
May 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
2a00d4e
WIP
May 11, 2023
700578c
WIP
May 11, 2023
d79ca7b
WIP
May 12, 2023
d5a893a
WIP
May 12, 2023
f82c865
WIP
May 12, 2023
55e9886
WIP
May 12, 2023
0d3890a
WIP
May 12, 2023
7dbe529
WIP
May 12, 2023
8e36366
Merge branch 'main' into issue-2465-use-extract-parameters
May 12, 2023
231713d
WIP
May 12, 2023
3c523db
Merge remote-tracking branch 'origin/issue-2465-use-extract-parameter…
May 12, 2023
c15c98d
WIP
May 12, 2023
47aa007
WIP
May 12, 2023
2474769
WIP
May 12, 2023
4e382e7
WIP
May 12, 2023
cf5ebef
WIP
May 12, 2023
13d3ec8
WIP
May 13, 2023
e92d5fe
WIP
May 13, 2023
64cbdc6
WIP
May 13, 2023
c3c9612
WIP
May 13, 2023
f6e030e
WIP
May 13, 2023
803d0dd
WIP
May 13, 2023
24222bf
WIP
May 13, 2023
a936f8e
WIP
May 13, 2023
55ee65a
WIP
May 13, 2023
359df69
WIP
May 13, 2023
7efb5c0
WIP
May 13, 2023
5925d9d
WIP
May 13, 2023
e35623d
WIP
May 13, 2023
de26fdd
Merge branch 'main' into issue-2465-use-extract-parameters
May 13, 2023
d783193
WIP
May 13, 2023
ce83ef1
Merge remote-tracking branch 'origin/issue-2465-use-extract-parameter…
May 13, 2023
89c42b5
WIP
May 13, 2023
5e194e3
WIP
May 13, 2023
d87e607
WIP
May 13, 2023
af3e0c4
WIP
May 13, 2023
54c194f
WIP
May 13, 2023
439bb7b
WIP
May 13, 2023
f002283
WIP
May 13, 2023
6f09db4
WIP
May 13, 2023
a7caeb0
WIP
May 13, 2023
2f350ba
WIP
May 13, 2023
b74bd94
Update internal/handlers/commonparams/params.go
May 15, 2023
57ffa78
WIP
May 15, 2023
faac1c4
Merge remote-tracking branch 'origin/issue-2465-use-extract-parameter…
May 15, 2023
2db00ce
WIP
May 15, 2023
bd52204
Merge branch 'main' into issue-2465-use-extract-parameters
May 15, 2023
4f58b74
Update internal/handlers/commonparams/extract_params.go
May 15, 2023
07e2d6d
WIP
May 15, 2023
902acdd
Merge remote-tracking branch 'origin/issue-2465-use-extract-parameter…
May 15, 2023
c5ae8d5
WIP
May 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
WIP
  • Loading branch information
Dmitry committed May 12, 2023
commit 231713dcfaeec05173a37055044a62fbbef0a013
7 changes: 3 additions & 4 deletions internal/handlers/common/find.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,14 @@ type FindParams struct {

// GetFindParams returns `find` command parameters.
func GetFindParams(doc *types.Document, l *zap.Logger) (*FindParams, error) {
var params FindParams
params := FindParams{
BatchSize: 101,
}

err := commonparams.ExtractParams(doc, "find", &params, l)
if err != nil {
return nil, err
}

// TODO: process default values somehow
params.BatchSize = 101

return &params, nil
}
2 changes: 1 addition & 1 deletion internal/handlers/commonparams/extract_params.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ func setStructField(elem *reflect.Value, i int, command, key string, val any, l

switch fv.Kind() { //nolint: exhaustive // all other types are not supported
case reflect.Int32, reflect.Int64, reflect.Float64:
if key == "skip" || key == "limit" {
if key == "skip" || key == "limit" || key == "batchSize" {
// limit value for the `delete` command has to be 0 or 1
if command == "delete" {
var limit int64
Expand Down