grafana/pkg/tsdb/query_endpoint.go

24 lines
514 B
Go
Raw Normal View History

2017-09-21 03:44:25 -05:00
package tsdb
import (
"context"
"github.com/grafana/grafana/pkg/models"
)
type TsdbQueryEndpoint interface {
Query(ctx context.Context, ds *models.DataSource, query *TsdbQuery) (*Response, error)
2017-09-21 03:44:25 -05:00
}
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
}