request.go 427 B

123456789101112131415161718
  1. package tsdb
  2. import (
  3. "context"
  4. "github.com/grafana/grafana/pkg/models"
  5. )
  6. type HandleRequestFunc func(ctx context.Context, dsInfo *models.DataSource, req *TsdbQuery) (*Response, error)
  7. func HandleRequest(ctx context.Context, dsInfo *models.DataSource, req *TsdbQuery) (*Response, error) {
  8. endpoint, err := getTsdbQueryEndpointFor(dsInfo)
  9. if err != nil {
  10. return nil, err
  11. }
  12. return endpoint.Query(ctx, dsInfo, req)
  13. }