Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
KIT-CA
websearch
Commits
0e7b576f
Commit
0e7b576f
authored
Apr 22, 2017
by
Heiko Reese
Browse files
Added filtering for results
parent
021b11c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
results.go
View file @
0e7b576f
...
...
@@ -57,6 +57,19 @@ func (r Searchresults) Less(i, j int) bool {
}
}
// Filter returns the subset of results that match filter
func
(
r
Searchresults
)
Filter
(
filter
SCFilter
)
Searchresults
{
filtered
:=
make
(
Searchresults
,
len
(
r
))
matches
:=
0
for
_
,
cert
:=
range
r
{
if
filter
(
cert
)
{
filtered
[
matches
]
=
cert
matches
++
}
}
return
filtered
[
:
matches
]
}
func
(
r
Searchresults
)
JSONString
(
watchers
map
[
int
]
*
AttributeState
)
[]
byte
{
result
:=
JSONShell
{
Results
:
make
([]
*
JSONResult
,
len
(
r
)),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment