Documentation
¶
Index ¶
- func DataqueryConverter(input Dataquery) string
- func VariantConfig() variants.DataqueryConfig
- type Dataquery
- type DataqueryBuilder
- func (builder *DataqueryBuilder) Build() (variants.Dataquery, error)
- func (builder *DataqueryBuilder) Datasource(datasource dashboard.DataSourceRef) *DataqueryBuilder
- func (builder *DataqueryBuilder) EditorMode(editorMode QueryEditorMode) *DataqueryBuilder
- func (builder *DataqueryBuilder) Expr(expr string) *DataqueryBuilder
- func (builder *DataqueryBuilder) Hide(hide bool) *DataqueryBuilder
- func (builder *DataqueryBuilder) Instant(instant bool) *DataqueryBuilder
- func (builder *DataqueryBuilder) LegendFormat(legendFormat string) *DataqueryBuilder
- func (builder *DataqueryBuilder) MaxLines(maxLines int64) *DataqueryBuilder
- func (builder *DataqueryBuilder) QueryType(queryType string) *DataqueryBuilder
- func (builder *DataqueryBuilder) Range(rangeArg bool) *DataqueryBuilder
- func (builder *DataqueryBuilder) RefId(refId string) *DataqueryBuilder
- func (builder *DataqueryBuilder) Resolution(resolution int64) *DataqueryBuilder
- func (builder *DataqueryBuilder) Step(step string) *DataqueryBuilder
- type LokiQueryDirection
- type LokiQueryType
- type QueryEditorMode
- type SupportingQueryType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DataqueryConverter ¶
DataqueryConverter accepts a `Dataquery` object and generates the Go code to build this object using builders.
func VariantConfig ¶
func VariantConfig() variants.DataqueryConfig
VariantConfig returns the configuration related to loki dataqueries. This configuration describes how to unmarshal it, convert it to code, …
Types ¶
type Dataquery ¶
type Dataquery struct { // The LogQL query. Expr string `json:"expr"` // Used to override the name of the series. LegendFormat *string `json:"legendFormat,omitempty"` // Used to limit the number of log rows returned. MaxLines *int64 `json:"maxLines,omitempty"` // @deprecated, now use step. Resolution *int64 `json:"resolution,omitempty"` EditorMode *QueryEditorMode `json:"editorMode,omitempty"` // @deprecated, now use queryType. Range *bool `json:"range,omitempty"` // @deprecated, now use queryType. Instant *bool `json:"instant,omitempty"` // Used to set step value for range queries. Step *string `json:"step,omitempty"` // A unique identifier for the query within the list of targets. // In server side expressions, the refId is used as a variable name to identify results. // By default, the UI will assign A->Z; however setting meaningful names may be useful. RefId string `json:"refId"` // If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel. Hide *bool `json:"hide,omitempty"` // Specify the query flavor // TODO make this required and give it a default QueryType *string `json:"queryType,omitempty"` // For mixed data sources the selected datasource is on the query level. // For non mixed scenarios this is undefined. // TODO find a better way to do this ^ that's friendly to schema // TODO this shouldn't be unknown but DataSourceRef | null Datasource *dashboard.DataSourceRef `json:"datasource,omitempty"` }
func (Dataquery) DataqueryType ¶
func (Dataquery) ImplementsDataqueryVariant ¶
func (resource Dataquery) ImplementsDataqueryVariant()
func (*Dataquery) UnmarshalJSONStrict ¶
UnmarshalJSONStrict implements a custom JSON unmarshalling logic to decode `Dataquery` from JSON. Note: the unmarshalling done by this function is strict. It will fail over required fields being absent from the input, fields having an incorrect type, unexpected fields being present, …
type DataqueryBuilder ¶
type DataqueryBuilder struct {
// contains filtered or unexported fields
}
func NewDataqueryBuilder ¶
func NewDataqueryBuilder() *DataqueryBuilder
func (*DataqueryBuilder) Build ¶
func (builder *DataqueryBuilder) Build() (variants.Dataquery, error)
func (*DataqueryBuilder) Datasource ¶
func (builder *DataqueryBuilder) Datasource(datasource dashboard.DataSourceRef) *DataqueryBuilder
For mixed data sources the selected datasource is on the query level. For non mixed scenarios this is undefined. TODO find a better way to do this ^ that's friendly to schema TODO this shouldn't be unknown but DataSourceRef | null
func (*DataqueryBuilder) EditorMode ¶
func (builder *DataqueryBuilder) EditorMode(editorMode QueryEditorMode) *DataqueryBuilder
func (*DataqueryBuilder) Expr ¶
func (builder *DataqueryBuilder) Expr(expr string) *DataqueryBuilder
The LogQL query.
func (*DataqueryBuilder) Hide ¶
func (builder *DataqueryBuilder) Hide(hide bool) *DataqueryBuilder
If hide is set to true, Grafana will filter out the response(s) associated with this query before returning it to the panel.
func (*DataqueryBuilder) Instant ¶
func (builder *DataqueryBuilder) Instant(instant bool) *DataqueryBuilder
@deprecated, now use queryType.
func (*DataqueryBuilder) LegendFormat ¶
func (builder *DataqueryBuilder) LegendFormat(legendFormat string) *DataqueryBuilder
Used to override the name of the series.
func (*DataqueryBuilder) MaxLines ¶
func (builder *DataqueryBuilder) MaxLines(maxLines int64) *DataqueryBuilder
Used to limit the number of log rows returned.
func (*DataqueryBuilder) QueryType ¶
func (builder *DataqueryBuilder) QueryType(queryType string) *DataqueryBuilder
Specify the query flavor TODO make this required and give it a default
func (*DataqueryBuilder) Range ¶
func (builder *DataqueryBuilder) Range(rangeArg bool) *DataqueryBuilder
@deprecated, now use queryType.
func (*DataqueryBuilder) RefId ¶
func (builder *DataqueryBuilder) RefId(refId string) *DataqueryBuilder
A unique identifier for the query within the list of targets. In server side expressions, the refId is used as a variable name to identify results. By default, the UI will assign A->Z; however setting meaningful names may be useful.
func (*DataqueryBuilder) Resolution ¶
func (builder *DataqueryBuilder) Resolution(resolution int64) *DataqueryBuilder
@deprecated, now use step.
func (*DataqueryBuilder) Step ¶
func (builder *DataqueryBuilder) Step(step string) *DataqueryBuilder
Used to set step value for range queries.
type LokiQueryDirection ¶
type LokiQueryDirection string
const ( LokiQueryDirectionForward LokiQueryDirection = "forward" LokiQueryDirectionBackward LokiQueryDirection = "backward" )
type LokiQueryType ¶
type LokiQueryType string
const ( LokiQueryTypeRange LokiQueryType = "range" LokiQueryTypeInstant LokiQueryType = "instant" LokiQueryTypeStream LokiQueryType = "stream" )
type QueryEditorMode ¶
type QueryEditorMode string
const ( QueryEditorModeCode QueryEditorMode = "code" QueryEditorModeBuilder QueryEditorMode = "builder" )
type SupportingQueryType ¶
type SupportingQueryType string
const ( SupportingQueryTypeLogsVolume SupportingQueryType = "logsVolume" SupportingQueryTypeLogsSample SupportingQueryType = "logsSample" SupportingQueryTypeDataSample SupportingQueryType = "dataSample" SupportingQueryTypeInfiniteScroll SupportingQueryType = "infiniteScroll" )