forked from RedisTimeSeries/redistimeseries-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
multiget.go
34 lines (29 loc) · 840 Bytes
/
multiget.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
package redis_timeseries_go
// MultiGetOptions represent the options for querying across multiple time-series
type MultiGetOptions struct {
WithLabels bool
}
// MultiGetOptions are the default options for querying across multiple time-series
var DefaultMultiGetOptions = MultiGetOptions{
WithLabels: false,
}
func NewMultiGetOptions() *MultiGetOptions {
return &MultiGetOptions{
WithLabels: false,
}
}
func (mgetopts *MultiGetOptions) SetWithLabels(value bool) *MultiGetOptions {
mgetopts.WithLabels = value
return mgetopts
}
func createMultiGetCmdArguments(mgetOptions MultiGetOptions, filters []string) []interface{} {
args := []interface{}{}
if mgetOptions.WithLabels {
args = append(args, "WITHLABELS")
}
args = append(args, "FILTER")
for _, filter := range filters {
args = append(args, filter)
}
return args
}