Documentation ¶
Index ¶
Constants ¶
const LineBreak = "\n"
Variables ¶
var CommandRunnerFactoryRegistry *commandRunnerFactoryRegistry
CommandRunnerFactoryRegistry is the global query engine factory registry
var (
ErrDialectNotSupported = errors.New("dialect not support")
)
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { // Cmd is a raw query expression Cmd string Dialect DialectType Database string // Start and End attributes are mainly used for PromQL currently // as it doesn't support time-bounding query expression itself Start *time.Time End *time.Time Timezone *time.Location Evaluation *time.Time // Step is evaluation step for PromQL. // As InfluxQL doesn't have the equivalent expression or concept, // we use it as interval parameter for InfluxQL GROUP BY time(interval) // if the raw query doesn't contain PromQL MatrixSelector expression. // If the raw query does contain PromQL parser.MatrixSelector expression, // its Range attribute will be used as the interval parameter. Step time.Duration DataType DataType // ValueFieldKey indicates which field will be used. // As matrix value field as measurement in InfluxDB may contain multiple fields that is different from Prometheus, // so we may need to set ValueFieldKey. // // Default is “`value“` field. ValueFieldKey string // LabelName is only used for label values query. LabelName string }
Command wraps a raw query expression with several related attributes
type CommandType ¶
type CommandType struct { OperationType OperationType DialectType DialectType }
CommandType indicates the type of Command in business meaning
type DataType ¶
type DataType int
DataType indicates a Command is for table display or for graph display in data visualization platform like Grafana Basically,
- TABLE_DATA is for raw table data query
- GRAPH_DATA is for time-bounding graph data query
- LABEL_VALUES_DATA is for label values data query like fetching data for label selector options at the top of Grafana dashboard
type DialectType ¶
type DialectType string
DialectType is alias of string type and indicates which query grammar a Command is using
type ICommandRunner ¶
ICommandRunner is an interface for query engine
type ICommandRunnerFactory ¶
type ICommandRunnerFactory interface {
Build(client influxdb.Client, cfg config.Config) ICommandRunner
}
ICommandRunnerFactory is an interface for query engine factory
type IReusableCommandRunner ¶
type IReusableCommandRunner interface { ICommandRunner Recycle() }
IReusableCommandRunner is an interface for query engine and supporting reuse itself
type OperationType ¶
type OperationType int
OperationType indicates a Command is for writing or for querying
const ( QUERY_OPERATION OperationType = iota + 1 WRITE_OPERATION = iota + 1 )