2016-10-04 22:25:33 +08:00
|
|
|
package influxdb
|
2016-10-05 03:28:05 +08:00
|
|
|
|
2017-11-15 18:22:00 +08:00
|
|
|
import "time"
|
|
|
|
|
|
2016-10-05 16:56:34 +08:00
|
|
|
type Query struct {
|
2016-10-05 03:28:05 +08:00
|
|
|
Measurement string
|
|
|
|
|
Policy string
|
|
|
|
|
ResultFormat string
|
2016-10-05 16:56:34 +08:00
|
|
|
Tags []*Tag
|
|
|
|
|
GroupBy []*QueryPart
|
|
|
|
|
Selects []*Select
|
2016-10-12 00:29:09 +08:00
|
|
|
RawQuery string
|
2016-11-10 21:16:18 +08:00
|
|
|
UseRawQuery bool
|
2016-11-09 02:22:59 +08:00
|
|
|
Alias string
|
2017-11-15 18:22:00 +08:00
|
|
|
Interval time.Duration
|
2018-12-21 23:38:53 +08:00
|
|
|
Tz string
|
2016-10-05 03:28:05 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Tag struct {
|
2016-10-05 22:57:32 +08:00
|
|
|
Key string
|
|
|
|
|
Operator string
|
|
|
|
|
Value string
|
|
|
|
|
Condition string
|
2016-10-05 03:28:05 +08:00
|
|
|
}
|
|
|
|
|
|
2016-10-05 16:56:34 +08:00
|
|
|
type Select []QueryPart
|
|
|
|
|
|
2016-10-06 20:16:26 +08:00
|
|
|
type Response struct {
|
|
|
|
|
Results []Result
|
2021-04-22 14:43:17 +08:00
|
|
|
Error string
|
2016-10-06 20:16:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Result struct {
|
|
|
|
|
Series []Row
|
|
|
|
|
Messages []*Message
|
2021-04-22 14:43:17 +08:00
|
|
|
Error string
|
2016-10-06 20:16:26 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Message struct {
|
|
|
|
|
Level string `json:"level,omitempty"`
|
|
|
|
|
Text string `json:"text,omitempty"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
type Row struct {
|
|
|
|
|
Name string `json:"name,omitempty"`
|
|
|
|
|
Tags map[string]string `json:"tags,omitempty"`
|
|
|
|
|
Columns []string `json:"columns,omitempty"`
|
|
|
|
|
Values [][]interface{} `json:"values,omitempty"`
|
|
|
|
|
}
|