plugin

package
v0.0.0-...-8d3a93b Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSampleDatasource

NewSampleDatasource creates a new datasource instance.

Types

type SampleDatasource

type SampleDatasource struct{}

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

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

func (d *SampleDatasource) 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 (*SampleDatasource) PublishStream

PublishStream is called when a client sends a message to the stream.

func (*SampleDatasource) 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).

func (*SampleDatasource) RunStream

RunStream is called once for any open channel. Results are shared with everyone subscribed to the same channel.

func (*SampleDatasource) SubscribeStream

SubscribeStream is called when a client wants to connect to a stream. This callback allows sending the first message.

Jump to

Keyboard shortcuts

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