mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 18:30:41 -06:00
19 lines
427 B
Go
19 lines
427 B
Go
package tsdb
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
)
|
|
|
|
type HandleRequestFunc func(ctx context.Context, dsInfo *models.DataSource, req *TsdbQuery) (*Response, error)
|
|
|
|
func HandleRequest(ctx context.Context, dsInfo *models.DataSource, req *TsdbQuery) (*Response, error) {
|
|
endpoint, err := getTsdbQueryEndpointFor(dsInfo)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return endpoint.Query(ctx, dsInfo, req)
|
|
}
|