mirror of
https://github.com/grafana/grafana.git
synced 2024-12-01 21:19:28 -06:00
dff84f6a31
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
24 lines
514 B
Go
24 lines
514 B
Go
package tsdb
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
type TsdbQueryEndpoint interface {
|
|
Query(ctx context.Context, ds *models.DataSource, query *TsdbQuery) (*Response, error)
|
|
}
|
|
|
|
var registry map[string]GetTsdbQueryEndpointFn
|
|
|
|
type GetTsdbQueryEndpointFn func(dsInfo *models.DataSource) (TsdbQueryEndpoint, error)
|
|
|
|
func init() {
|
|
registry = make(map[string]GetTsdbQueryEndpointFn)
|
|
}
|
|
|
|
func RegisterTsdbQueryEndpoint(pluginId string, fn GetTsdbQueryEndpointFn) {
|
|
registry[pluginId] = fn
|
|
}
|