grpc.go 483 B

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