Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
asapo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
asapo
asapo
Commits
bdc8acf0
Commit
bdc8acf0
authored
10 months ago
by
Mikhail Karnevskiy
Browse files
Options
Downloads
Patches
Plain Diff
switch back to detailed default true
parent
6222a480
No related branches found
No related tags found
1 merge request
!222
Clean Cpp mart of MongoDB communication.
Pipeline
#117701
failed
10 months ago
Stage: build
Stage: test
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
broker/src/asapo_broker/server/get_commands_test.go
+1
-1
1 addition, 1 deletion
broker/src/asapo_broker/server/get_commands_test.go
broker/src/asapo_broker/server/get_streams.go
+7
-5
7 additions, 5 deletions
broker/src/asapo_broker/server/get_streams.go
with
8 additions
and
6 deletions
broker/src/asapo_broker/server/get_commands_test.go
+
1
−
1
View file @
bdc8acf0
...
@@ -53,7 +53,7 @@ var testsGetCommand = []struct {
...
@@ -53,7 +53,7 @@ var testsGetCommand = []struct {
expectedGroupID
+
"/next"
,
"&resend_nacks=true&delay_ms=10000&resend_attempts=3"
,
"{
\"
id_key
\"
:
\"
_id
\"
,
\"
resend
\"
:true,
\"
delay_ms
\"
:10000,
\"
resend_attempts
\"
:3}"
},
expectedGroupID
+
"/next"
,
"&resend_nacks=true&delay_ms=10000&resend_attempts=3"
,
"{
\"
id_key
\"
:
\"
_id
\"
,
\"
resend
\"
:true,
\"
delay_ms
\"
:10000,
\"
resend_attempts
\"
:3}"
},
{
"size"
,
expectedSource
,
expectedStream
,
""
,
expectedStream
+
"/size"
,
""
,
""
},
{
"size"
,
expectedSource
,
expectedStream
,
""
,
expectedStream
+
"/size"
,
""
,
""
},
{
"size"
,
expectedSource
,
expectedStream
,
""
,
expectedStream
+
"/size"
,
"&incomplete=true"
,
"true"
},
{
"size"
,
expectedSource
,
expectedStream
,
""
,
expectedStream
+
"/size"
,
"&incomplete=true"
,
"true"
},
{
"streams"
,
expectedSource
,
"0"
,
""
,
"0/streams"
,
""
,
"{
\"
from
\"
:
\"\"
,
\"
filter
\"
:
\"
all
\"
,
\"
detailed
\"
:
fals
e,
\"
last
\"
:false,
\"
single
\"
:false}"
},
{
"streams"
,
expectedSource
,
"0"
,
""
,
"0/streams"
,
""
,
"{
\"
from
\"
:
\"\"
,
\"
filter
\"
:
\"
all
\"
,
\"
detailed
\"
:
tru
e,
\"
last
\"
:false,
\"
single
\"
:false}"
},
{
"lastack"
,
expectedSource
,
expectedStream
,
expectedGroupID
,
expectedStream
+
"/"
+
expectedGroupID
+
"/lastack"
,
""
,
""
},
{
"lastack"
,
expectedSource
,
expectedStream
,
expectedGroupID
,
expectedStream
+
"/"
+
expectedGroupID
+
"/lastack"
,
""
,
""
},
{
"datasources"
,
expectedSource
,
"0"
,
""
,
"0/sources"
,
""
,
""
},
{
"datasources"
,
expectedSource
,
"0"
,
""
,
"0/sources"
,
""
,
""
},
}
}
...
...
This diff is collapsed.
Click to expand it.
broker/src/asapo_broker/server/get_streams.go
+
7
−
5
View file @
bdc8acf0
...
@@ -10,12 +10,14 @@ import (
...
@@ -10,12 +10,14 @@ import (
type
GetStreamsParams
=
database
.
GetStreamsParams
type
GetStreamsParams
=
database
.
GetStreamsParams
func
getBoolKey
(
vals
url
.
Values
,
key
string
)
(
bool
,
bool
)
{
func
getBoolKey
(
vals
url
.
Values
,
key
string
,
defaultVal
bool
)
(
bool
,
bool
)
{
val_str
:=
vals
.
Get
(
key
)
val_str
:=
vals
.
Get
(
key
)
if
val_str
==
"true"
{
if
val_str
==
"true"
{
return
true
,
true
return
true
,
true
}
else
if
val_str
==
"false"
||
val_str
==
""
{
}
else
if
val_str
==
"false"
{
return
false
,
true
return
false
,
true
}
else
if
val_str
==
""
{
return
defaultVal
,
true
}
else
{
}
else
{
return
false
,
false
return
false
,
false
}
}
...
@@ -37,17 +39,17 @@ func getFilterKey(vals url.Values) (string, bool) {
...
@@ -37,17 +39,17 @@ func getFilterKey(vals url.Values) (string, bool) {
func
routeGetStreams
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
func
routeGetStreams
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
keys
:=
r
.
URL
.
Query
()
keys
:=
r
.
URL
.
Query
()
detailed
,
ok
:=
getBoolKey
(
keys
,
"detailed"
)
detailed
,
ok
:=
getBoolKey
(
keys
,
"detailed"
,
true
)
if
!
ok
{
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusBadRequest
)
w
.
WriteHeader
(
http
.
StatusBadRequest
)
return
return
}
}
last
,
ok
:=
getBoolKey
(
keys
,
"last"
)
last
,
ok
:=
getBoolKey
(
keys
,
"last"
,
false
)
if
!
ok
{
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusBadRequest
)
w
.
WriteHeader
(
http
.
StatusBadRequest
)
return
return
}
}
single
,
ok
:=
getBoolKey
(
keys
,
"single"
)
single
,
ok
:=
getBoolKey
(
keys
,
"single"
,
false
)
if
!
ok
{
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusBadRequest
)
w
.
WriteHeader
(
http
.
StatusBadRequest
)
return
return
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment