plugin

package
v0.0.0-...-f8d411b Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PERCENTAGE string = "PERCENTAGE"
	NUMBER     string = "NUMBER"
	TIMESTAMP  string = "TIMESTAMP"
)
View Source
const BREAKDOWN = "BREAKDOWN"
View Source
const COLUMN = "COLUMN"

Possible values for the "resultType" of a Power Query

View Source
const DISTRIBUTION = "DISTRIBUTION"
View Source
const ERROR = "ERROR"
View Source
const FACET_VALUES = "FACET_VALUES"
View Source
const HIGH = "HIGH"
View Source
const LOG = "LOG"

Possible values for the request "type"

View Source
const LOW = "LOW"

Possible values for "frequency" of PLOT requests

View Source
const OK = "OK"

Possible values for the "outcome" of LRQData

View Source
const PLOT = "PLOT"

PLOT is a value for both a request "type" and a PQ "resultType"

View Source
const PQ = "PQ"
View Source
const TABLE = "TABLE"
View Source
const TIMEOUT = "TIMEOUT"
View Source
const TOP_FACETS = "TOP_FACETS"

Variables

This section is empty.

Functions

Types

type Column

type Column struct {
	Name          string `json:"name"`
	Type          string `json:"cellType"`
	DecimalPlaces int    `json:"decimalPlaces"`
}

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 (*DataSetDatasource) CheckHealth

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

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 DistributionOptions struct {
	Filter string `json:"filter"`
	Facet  string `json:"facet"`
}

type Facet

type Facet struct {
	Values []FacetValue `json:"values"`
}

type FacetList

type FacetList struct {
	Facet Facet `json:"facet"`
}

type FacetOptions

type FacetOptions struct {
	Name      string `json:"name"`
	MaxValues string `json:"maxValues"`
}

type FacetQuery

type FacetQuery struct {
	QueryType   string        `json:"queryType"`
	FacetValues *FacetOptions `json:"facetValues"`
}

type FacetRequest

type FacetRequest struct {
	QueryType string `json:"queryType"`
	MaxCount  int    `json:"maxCount"`

	Field string `json:"field"`
}

type FacetResponse

type FacetResponse struct {
	Value []string `json:"value"`
}

type FacetValue

type FacetValue struct {
	Value string `json:"value"`
}

type Facets

type Facets struct {
	Name string `json:"name"`
}

type LRQError

type LRQError struct {
	Message string `json:"message"`
}

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 LRQResult

type LRQResult struct {
	Id             string          `json:"id"`
	StepsCompleted int             `json:"stepsCompleted"`
	StepsTotal     int             `json:"totalSteps"`
	Data           json.RawMessage `json:"data"` // Depending on expected response, need to unmarshal to different structs
	Error          *LRQError       `json:"error"`
}

type LogOptions

type LogOptions struct {
	Filter    string `json:"filter"`
	Ascending bool   `json:"ascending"`
	Limit     int    `json:"limit"`
	Cursor    string `json:"cursor"`
}

type PQOptions

type PQOptions struct {
	Query      string `json:"query"`
	ResultType string `json:"resultType"`
}

type PlotData

type PlotData struct {
	Label   string    `json:"label"`
	Samples []float64 `json:"samples"`
}

type PlotOptions

type PlotOptions struct {
	Filter         string  `json:"filter"`
	Slices         int64   `json:"slices"`
	SliceWidth     *string `json:"sliceWidth"`
	AutoAlign      bool    `json:"autoAlign"`
	Expression     string  `json:"expression"`
	BreakdownFacet *string `json:"breakdownFacet"`
	Frequency      string  `json:"frequency"`
}

type PlotResultData

type PlotResultData struct {
	XAxis []int64    `json:"xAxis"`
	Plots []PlotData `json:"plots"`
}

type ResolvedTimeRange

type ResolvedTimeRange struct {
	Min int `json:"min"`
	Max int `json:"max"`
}

type TableResultData

type TableResultData struct {
	Columns []Column        `json:"columns"`
	Values  [][]interface{} `json:"values"`
}

type TopFacetOptions

type TopFacetOptions struct {
	NumFacetsToReturn int    `json:"numFacetsToReturn"`
	DetermineNumeric  bool   `json:"determineNumeric"`
	Filter            string `json:"filter"`
}

type TopFacetRequest

type TopFacetRequest struct {
	QueryType string           `json:"queryType"`
	TopFacet  *TopFacetOptions `json:"topFacets"`
}

type TopFacets

type TopFacets struct {
	Facets []Facets `json:"facets"`
}

type Values

type Values struct {
	Name string `json:"name"`
	Type string `json:"cellType"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL