Documentation
¶
Index ¶
- Constants
- func BuildBoolQuery(filters []*Filter, boolQuery *elastic.BoolQuery) error
- func ConvertAstToStatement(statement string) (string, error)
- func ElasticSearchCURL(url string, indices []string, source interface{}) string
- func ParseTimeRange(start, end, timestamp, latest string) (st int64, et int64, err error)
- func ParseTimestamp(value string, now int64) (int64, error)
- type AstField
- type AstStatement
- type Filter
- type OrderBy
- type Queryer
- type ResultSet
Constants ¶
View Source
const ( TimestampKey = tsql.TimestampKey NameKey = tsql.NameKey TagKey = "tags" FieldKey = "fields" ClusterNameKey = TagKey + ".cluster_name" )
metric keys
Variables ¶
This section is empty.
Functions ¶
func BuildBoolQuery ¶
BuildBoolQuery .
func ConvertAstToStatement ¶
ConvertAstToStatement .
func ElasticSearchCURL ¶
ElasticSearchCURL .
func ParseTimeRange ¶
ParseTimeRange .
Types ¶
type AstField ¶
type AstField struct {
Expr string `json:"expr"`
Alias string `json:"alias"`
Key string `json:"key"`
}
AstField .
type AstStatement ¶
type AstStatement struct {
Select []*AstField `json:"select"`
From []string `json:"from"`
Where []string `json:"where"`
GroupBy []string `json:"groupby"`
OrderBy []*OrderBy `json:"orderby"`
Limit int64 `json:"limit"`
}
AstStatement .
type Queryer ¶
type Queryer interface {
Query(tsql, statement string, params map[string]interface{}, options url.Values) (*ResultSet, error)
QueryWithFormat(tsql, statement, format string, langCodes i18n.LanguageCodes, params map[string]interface{}, filters []*Filter, options url.Values) (*ResultSet, interface{}, error)
Export(tsql, statement string, params map[string]interface{}, options url.Values, handle func(id string, source []byte) error) error // 暂时没用到, 待移除
QueryRaw(metrics, clusters []string, start, end int64, searchSource *elastic.SearchSource) (*elastic.SearchResult, error)
SearchRaw(indices []string, searchSource *elastic.SearchSource) (*elastic.SearchResult, error)
}
Queryer .
Click to show internal directories.
Click to hide internal directories.