grpc.go 477 B

12345678910111213141516171819202122
  1. package tsdb
  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. func (m *GRPCClient) Query(ctx context.Context, req *proto.TsdbQuery) (*proto.Response, error) {
  10. return m.TsdbPluginClient.Query(ctx, req)
  11. }
  12. type GRPCServer struct {
  13. TsdbPlugin
  14. }
  15. func (m *GRPCServer) Query(ctx context.Context, req *proto.TsdbQuery) (*proto.Response, error) {
  16. return m.TsdbPlugin.Query(ctx, req)
  17. }