plugin

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	UnixTimestampSeconds     = "1"
	UnixTimestampMiniseconds = "2"
)

Functions

func NewDatasource

NewDatasource creates a new datasource instance.

func Pointer

func Pointer[K any](val K) *K

func PrintDataFrame

func PrintDataFrame(dataFrame *data.Frame)

func QueryResultToDataFrame

func QueryResultToDataFrame(dataFrameName string, output *dynamodb.ExecuteStatementOutput, datetimeAttributes map[string]string) (*data.Frame, error)

Types

type Attribute

type Attribute struct {
	Name     string
	Value    *data.Field
	TsFormat string
}

func NewAttribute

func NewAttribute(rowIndex int, name string, value *dynamodb.AttributeValue, datetimeFormat string) (*Attribute, error)

func (*Attribute) Append

func (c *Attribute) Append(value *dynamodb.AttributeValue) error

func (*Attribute) Size

func (c *Attribute) Size() int

func (*Attribute) Type

func (c *Attribute) Type() data.FieldType

type DataRow

type DataRow map[string]*dynamodb.AttributeValue

type Datasource

type Datasource struct {
	Settings awsds.AWSDatasourceSettings
	// contains filtered or unexported fields
}

Datasource is an example datasource which can respond to data queries, reports its health and has streaming skills.

func CreateTestDatasource

func CreateTestDatasource(ctx context.Context) *Datasource

func (*Datasource) 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 (*Datasource) Dispose

func (d *Datasource) 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 NewSampleDatasource factory function.

func (*Datasource) 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 DatetimeAttribute

type DatetimeAttribute struct {
	Name   string
	Format string
}

type ExtraPluginSettings

type ExtraPluginSettings struct {
	ConnectionTestTable string `json:"connectionTestTable"`
}

type QueryModel

type QueryModel struct {
	QueryText          string
	Limit              int64
	DatetimeAttributes []DatetimeAttribute
}

Jump to

Keyboard shortcuts

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