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
Joao Alvim Oliveira Dias De Almeida
asapo
Commits
bdc8acf0
Commit
bdc8acf0
authored
11 months ago
by
Mikhail Karnevskiy
Browse files
Options
Downloads
Patches
Plain Diff
switch back to detailed default true
parent
6222a480
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
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 {
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"
,
"&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"
,
""
,
""
},
{
"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 (
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
)
if
val_str
==
"true"
{
return
true
,
true
}
else
if
val_str
==
"false"
||
val_str
==
""
{
}
else
if
val_str
==
"false"
{
return
false
,
true
}
else
if
val_str
==
""
{
return
defaultVal
,
true
}
else
{
return
false
,
false
}
...
...
@@ -37,17 +39,17 @@ func getFilterKey(vals url.Values) (string, bool) {
func
routeGetStreams
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
keys
:=
r
.
URL
.
Query
()
detailed
,
ok
:=
getBoolKey
(
keys
,
"detailed"
)
detailed
,
ok
:=
getBoolKey
(
keys
,
"detailed"
,
true
)
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusBadRequest
)
return
}
last
,
ok
:=
getBoolKey
(
keys
,
"last"
)
last
,
ok
:=
getBoolKey
(
keys
,
"last"
,
false
)
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusBadRequest
)
return
}
single
,
ok
:=
getBoolKey
(
keys
,
"single"
)
single
,
ok
:=
getBoolKey
(
keys
,
"single"
,
false
)
if
!
ok
{
w
.
WriteHeader
(
http
.
StatusBadRequest
)
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