plugin

package
v0.0.0-...-ffb82a6 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UNIT_CONVERT_NONE          = iota
	UNIT_CONVERT_DEG_TO_RAD    = iota
	UNIT_CONVERT_RAD_TO_DEG    = iota
	UNIT_CONVERT_RAD_TO_ARCSEC = iota
	UNIT_CONVERT_K_TO_C        = iota
	UNIT_CONVERT_C_TO_K        = iota
)

Define the unit conversions, this maps onto the unitConversionOptions list in QueryEditor.tsx

View Source
const (
	TRANSFORM_NONE                  = iota
	TRANSFORM_FIRST_DERIVATVE       = iota
	TRANSFORM_FIRST_DERIVATVE_1HZ   = iota
	TRANSFORM_FIRST_DERIVATVE_10HZ  = iota
	TRANSFORM_FIRST_DERIVATVE_100HZ = iota
	TRANSFORM_DELTA                 = iota
)

Define the data transforms, this maps onto the transformOptions list in QueryEditor.tsx

Variables

This section is empty.

Functions

func NewDatasource

NewDatasource creates a new datasource instance.

Types

type DatasourceSettings

type DatasourceSettings struct {
	Server    string `json:"server"`
	Port      string `json:"port"`
	Role      string `json:"role"`
	Database  string `json:"database"`
	MetaTable string `json:"metatable"`
}

DatasourceSettings contains Postgres connection information

func LoadSettings

func LoadSettings(ctx backend.PluginContext) (*DatasourceSettings, error)

LoadSettings gets the relevant settings from the plugin context

type KeywordDatasource

type KeywordDatasource struct {
	backend.CallResourceHandler
	// contains filtered or unexported fields
}

func (*KeywordDatasource) 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 (*KeywordDatasource) QueryData

QueryData handles multiple queries and returns multiple responses. req contains the queries []DataQuery (where each query contains RefID as a unique identifer). The QueryDataResponse contains a map of RefID to the response for each query, and each response contains Frames ([]*Frame).

Jump to

Keyboard shortcuts

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