github.com/Consensys/quorum@v21.1.0+incompatible/plugin/helloworld/connector.go (about)

     1  package helloworld
     2  
     3  import (
     4  	"context"
     5  
     6  	iplugin "github.com/ethereum/go-ethereum/internal/plugin"
     7  	"github.com/hashicorp/go-plugin"
     8  	"github.com/jpmorganchase/quorum-hello-world-plugin-sdk-go/proto"
     9  	"google.golang.org/grpc"
    10  )
    11  
    12  const ConnectorName = "ping"
    13  
    14  type PluginConnector struct {
    15  	plugin.Plugin
    16  }
    17  
    18  func (p *PluginConnector) GRPCServer(b *plugin.GRPCBroker, s *grpc.Server) error {
    19  	return iplugin.ErrNotSupported
    20  }
    21  
    22  func (p *PluginConnector) GRPCClient(ctx context.Context, b *plugin.GRPCBroker, cc *grpc.ClientConn) (interface{}, error) {
    23  	return &PluginGateway{
    24  		client: proto.NewPluginGreetingClient(cc),
    25  	}, nil
    26  }