Documentation ¶
Index ¶
- Constants
- func NewDataSetDatasource(settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error)
- type Column
- type DataSetClient
- type DataSetDatasource
- func (d *DataSetDatasource) CallResource(ctx context.Context, req *backend.CallResourceRequest, ...) error
- func (d *DataSetDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
- func (d *DataSetDatasource) Dispose()
- func (d *DataSetDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
- type DistributionOptions
- type Facet
- type FacetList
- type FacetOptions
- type FacetQuery
- type FacetRequest
- type FacetResponse
- type FacetValue
- type Facets
- type LRQError
- type LRQRequest
- type LRQResult
- type LogOptions
- type PQOptions
- type PlotData
- type PlotOptions
- type PlotResultData
- type ResolvedTimeRange
- type TableResultData
- type TopFacetOptions
- type TopFacetRequest
- type TopFacets
- type Values
Constants ¶
const ( PERCENTAGE string = "PERCENTAGE" NUMBER string = "NUMBER" TIMESTAMP string = "TIMESTAMP" )
const BREAKDOWN = "BREAKDOWN"
const COLUMN = "COLUMN"
Possible values for the "resultType" of a Power Query
const DISTRIBUTION = "DISTRIBUTION"
const ERROR = "ERROR"
const FACET_VALUES = "FACET_VALUES"
const HIGH = "HIGH"
const LOG = "LOG"
Possible values for the request "type"
const LOW = "LOW"
Possible values for "frequency" of PLOT requests
const OK = "OK"
Possible values for the "outcome" of LRQData
const PLOT = "PLOT"
PLOT is a value for both a request "type" and a PQ "resultType"
const PQ = "PQ"
const TABLE = "TABLE"
const TIMEOUT = "TIMEOUT"
const TOP_FACETS = "TOP_FACETS"
Variables ¶
This section is empty.
Functions ¶
func NewDataSetDatasource ¶
func NewDataSetDatasource(settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error)
Types ¶
type DataSetClient ¶
type DataSetClient interface { DoLRQRequest(ctx context.Context, req LRQRequest) (*LRQResult, error) DoFacetValuesRequest(ctx context.Context, req FacetQuery) (*LRQResult, error) DoTopFacetRequest(ctx context.Context, req TopFacetRequest) (*LRQResult, error) DoFacetRequest(ctx context.Context, req FacetRequest) (int, error) }
func NewDataSetClient ¶
func NewDataSetClient(dataSetUrl string, apiKey string) DataSetClient
type DataSetDatasource ¶
type DataSetDatasource struct {
// contains filtered or unexported fields
}
func (*DataSetDatasource) CallResource ¶
func (d *DataSetDatasource) CallResource(ctx context.Context, req *backend.CallResourceRequest, sender backend.CallResourceResponseSender) error
func (*DataSetDatasource) CheckHealth ¶
func (d *DataSetDatasource) CheckHealth(ctx context.Context, req *backend.CheckHealthRequest) (*backend.CheckHealthResult, error)
CheckHealth handles health checks sent from Grafana to the plugin. The main use case for these health checks is the test button on the datasource configuration page which allows users to verify that a datasource is working as expected.
func (*DataSetDatasource) Dispose ¶
func (d *DataSetDatasource) Dispose()
Dispose here tells plugin SDK that plugin wants to clean up resources when a new instance created. As soon as datasource settings change detected by SDK old datasource instance will be disposed and a new one will be created using NewDataSetDatasource factory function.
func (*DataSetDatasource) QueryData ¶
func (d *DataSetDatasource) QueryData(ctx context.Context, req *backend.QueryDataRequest) (*backend.QueryDataResponse, error)
QueryData handles multiple queries and returns multiple responses. req contains the queries []DataQuery (where each query contains RefID as a unique identifier). The QueryDataResponse contains a map of RefID to the response for each query, and each response contains Frames ([]*Frame).
type DistributionOptions ¶
type Facet ¶
type Facet struct {
Values []FacetValue `json:"values"`
}
type FacetOptions ¶
type FacetQuery ¶
type FacetQuery struct { QueryType string `json:"queryType"` FacetValues *FacetOptions `json:"facetValues"` }
type FacetRequest ¶
type FacetResponse ¶
type FacetResponse struct {
Value []string `json:"value"`
}
type FacetValue ¶
type FacetValue struct {
Value string `json:"value"`
}
type LRQRequest ¶
type LRQRequest struct { QueryType string `json:"queryType"` StartTime int64 `json:"startTime"` EndTime int64 `json:"endTime"` TeamEmails []string `json:"teamEmails"` Log *LogOptions `json:"log"` Facet *FacetOptions `json:"facetValues"` TopFacet *TopFacetOptions `json:"topFacets"` Pq *PQOptions `json:"pq"` Plot *PlotOptions `json:"plot"` Distribution *DistributionOptions `json:"distribution"` }
type LogOptions ¶
type PlotOptions ¶
type PlotResultData ¶
type ResolvedTimeRange ¶
type TableResultData ¶
type TableResultData struct { Columns []Column `json:"columns"` Values [][]interface{} `json:"values"` }
type TopFacetOptions ¶
type TopFacetRequest ¶
type TopFacetRequest struct { QueryType string `json:"queryType"` TopFacet *TopFacetOptions `json:"topFacets"` }