-
Notifications
You must be signed in to change notification settings - Fork 0
/
filter.go
39 lines (34 loc) · 846 Bytes
/
filter.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright 2020 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package charmhub
import (
"fmt"
)
func appendFilterList(value string, filters []string) []string {
retVals := make([]string, len(filters))
for i, v := range filters {
retVals[i] = fmt.Sprintf("%s.%s", value, v)
}
return retVals
}
var defaultChannelFilter = []string{
"channel.name",
"channel.base.architecture",
"channel.base.name",
"channel.base.channel",
"channel.released-at",
"channel.risk",
"channel.track",
}
var defaultResultFilter = []string{
"result.categories.featured",
"result.categories.name",
"result.contains-charms.name",
"result.contains-charms.package-id",
"result.contains-charms.store-url",
"result.description",
"result.license",
"result.publisher.display-name",
"result.store-url",
"result.summary",
}