grpc.go 568 B

123456789101112131415161718192021222324
  1. package proxy
  2. import (
  3. proto "github.com/grafana/grafana/pkg/tsdb/models"
  4. "golang.org/x/net/context"
  5. )
  6. type GRPCClient struct {
  7. proto.TsdbPluginClient
  8. }
  9. //Query(ctx context.Context, ds *models.DataSource, query *TsdbQuery) (*Response, error)
  10. func (m *GRPCClient) Query(ctx context.Context, req *proto.TsdbQuery) (*proto.Response, error) {
  11. return m.TsdbPluginClient.Query(ctx, req)
  12. }
  13. type GRPCServer struct {
  14. TsdbPlugin
  15. }
  16. func (m *GRPCServer) Query(ctx context.Context, req *proto.TsdbQuery) (*proto.Response, error) {
  17. return m.TsdbPlugin.Query(ctx, req)
  18. }