-
Notifications
You must be signed in to change notification settings - Fork 0
/
dql.go
70 lines (60 loc) · 2.85 KB
/
dql.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT License.
// This product includes software developed at Guance Cloud (https://www.guance.com/).
// Copyright 2021-present Guance, Inc.
// Package dql wraps DQL query SDK.
package dql
type QueryRule struct {
Rule string `json:"rule"`
Index []string `json:"indexes"`
}
type WorkspaceIndexRule struct {
WorkspaceUUID string `json:"workspace_uuid"`
IndexName string `json:"index_name"`
Rules map[string][]QueryRule `json:"rules"`
}
type DorisIndices struct {
TenantID string `json:"tenant_id"`
IndexName string `json:"index_name"`
Condition string `json:"conditions"`
}
// DQL query options defined in(internal only)
//
// https://confluence.jiagouyun.com/pages/viewpage.action?pageId=196018193
type dql struct {
SearchAfter []any `json:"search_after"`
TimeRange []int `json:"time_range,omitempty"`
OrderBy []orderBy `json:"orderby,omitempty"`
NOrderBy []map[string]string `json:"order_by"` // the newer order-by
NSOrderBy []map[string]string `json:"sorder_by"` // the newer sorder-by
IndexList []*WorkspaceIndexRule `json:"index_list,omitempty"`
Conditions string `json:"conditions,omitempty"`
DQL string `json:"query"`
MaxDuration string `json:"max_duration,omitempty"`
AsyncTimeout string `json:"async_timeout,omitempty"`
Timeout string `json:"search_timeout,omitempty"`
OutputFormat string `json:"output_format,omitempty"`
AsyncID string `json:"async_id"`
QType string `json:"qtype"` // dql or promql
SLimit int `json:"slimit,omitempty"`
SOffset int `json:"soffset,omitempty"`
Offset int `json:"offset,omitempty"`
MaxPoint int `json:"max_point,omitempty"`
CursorTime int64 `json:"cursor_time"`
Interval int64 `json:"interval"`
Limit int64 `json:"limit"`
Rules map[string][]QueryRule `json:"rules"` // rules
DisableQueryParse bool `json:"disable_query_parse,omitempty"`
DisableSLimit bool `json:"disable_slimit,omitempty"`
Highlight bool `json:"highlight,omitempty"`
DisableMultipleField bool `json:"disable_multiple_field,omitempty"`
DisableExpensiveQueryDeprecated bool `json:"disable_expensive_query,omitempty"`
ShowLabelDeprecated bool `json:"show_label,omitempty"`
IsAsync bool `json:"is_async,omitempty"`
MaskVisible bool `json:"mask_visible,omitempty"`
Profile bool `json:"is_profile,omitempty"`
Optimized bool `json:"is_optimized,omitempty"`
DisableSampling bool `json:"disable_sampling,omitempty"`
AlignTime bool `json:"align_time"`
DisallowLargeQuery bool `json:"disallow_large_query"`
}