datasource

package
v0.30.1-0...-025f12f Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInstanceManager

func NewInstanceManager(fn InstanceFactoryFunc) instancemgmt.InstanceManager

NewInstanceManager creates a new data source instance manager,

This is a helper method for calling NewInstanceProvider and creating a new instancemgmt.InstanceProvider, and providing that to instancemgmt.New.

func NewInstanceProvider

func NewInstanceProvider(fn InstanceFactoryFunc) instancemgmt.InstanceProvider

NewInstanceProvider create a new data source instance provuder,

The instance provider is responsible for providing cache keys for data source instances, creating new instances when needed and invalidating cached instances when they have been updated in Grafana. Cache key is based on the numerical data source identifier. If fn is nil, NewInstanceProvider panics.

func Serve

func Serve(opts ServeOpts) error

Serve starts serving the data source over gPRC.

Types

type InstanceFactoryFunc

type InstanceFactoryFunc func(settings backend.DataSourceInstanceSettings) (instancemgmt.Instance, error)

InstanceFactoryFunc factory method for creating data source instances.

type ServeOpts

type ServeOpts struct {
	// CheckHealthHandler handler for health checks.
	// Optional to implement.
	backend.CheckHealthHandler

	// CallResourceHandler handler for resource calls.
	// Optional to implement.
	backend.CallResourceHandler

	// QueryDataHandler handler for data queries.
	// Required to implement.
	backend.QueryDataHandler

	// GRPCSettings settings for gPRC.
	GRPCSettings backend.GRPCSettings
}

ServeOpts options for serving a data source plugin.

Jump to

Keyboard shortcuts

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