github.com/hashicorp/go-plugin@v1.6.0/internal/plugin/grpc_broker_grpc.pb.go (about)

     1  // Copyright (c) HashiCorp, Inc.
     2  // SPDX-License-Identifier: MPL-2.0
     3  
     4  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     5  // versions:
     6  // - protoc-gen-go-grpc v1.3.0
     7  // - protoc             (unknown)
     8  // source: internal/plugin/grpc_broker.proto
     9  
    10  package plugin
    11  
    12  import (
    13  	context "context"
    14  	grpc "google.golang.org/grpc"
    15  	codes "google.golang.org/grpc/codes"
    16  	status "google.golang.org/grpc/status"
    17  )
    18  
    19  // This is a compile-time assertion to ensure that this generated file
    20  // is compatible with the grpc package it is being compiled against.
    21  // Requires gRPC-Go v1.32.0 or later.
    22  const _ = grpc.SupportPackageIsVersion7
    23  
    24  const (
    25  	GRPCBroker_StartStream_FullMethodName = "/plugin.GRPCBroker/StartStream"
    26  )
    27  
    28  // GRPCBrokerClient is the client API for GRPCBroker service.
    29  //
    30  // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
    31  type GRPCBrokerClient interface {
    32  	StartStream(ctx context.Context, opts ...grpc.CallOption) (GRPCBroker_StartStreamClient, error)
    33  }
    34  
    35  type gRPCBrokerClient struct {
    36  	cc grpc.ClientConnInterface
    37  }
    38  
    39  func NewGRPCBrokerClient(cc grpc.ClientConnInterface) GRPCBrokerClient {
    40  	return &gRPCBrokerClient{cc}
    41  }
    42  
    43  func (c *gRPCBrokerClient) StartStream(ctx context.Context, opts ...grpc.CallOption) (GRPCBroker_StartStreamClient, error) {
    44  	stream, err := c.cc.NewStream(ctx, &GRPCBroker_ServiceDesc.Streams[0], GRPCBroker_StartStream_FullMethodName, opts...)
    45  	if err != nil {
    46  		return nil, err
    47  	}
    48  	x := &gRPCBrokerStartStreamClient{stream}
    49  	return x, nil
    50  }
    51  
    52  type GRPCBroker_StartStreamClient interface {
    53  	Send(*ConnInfo) error
    54  	Recv() (*ConnInfo, error)
    55  	grpc.ClientStream
    56  }
    57  
    58  type gRPCBrokerStartStreamClient struct {
    59  	grpc.ClientStream
    60  }
    61  
    62  func (x *gRPCBrokerStartStreamClient) Send(m *ConnInfo) error {
    63  	return x.ClientStream.SendMsg(m)
    64  }
    65  
    66  func (x *gRPCBrokerStartStreamClient) Recv() (*ConnInfo, error) {
    67  	m := new(ConnInfo)
    68  	if err := x.ClientStream.RecvMsg(m); err != nil {
    69  		return nil, err
    70  	}
    71  	return m, nil
    72  }
    73  
    74  // GRPCBrokerServer is the server API for GRPCBroker service.
    75  // All implementations should embed UnimplementedGRPCBrokerServer
    76  // for forward compatibility
    77  type GRPCBrokerServer interface {
    78  	StartStream(GRPCBroker_StartStreamServer) error
    79  }
    80  
    81  // UnimplementedGRPCBrokerServer should be embedded to have forward compatible implementations.
    82  type UnimplementedGRPCBrokerServer struct {
    83  }
    84  
    85  func (UnimplementedGRPCBrokerServer) StartStream(GRPCBroker_StartStreamServer) error {
    86  	return status.Errorf(codes.Unimplemented, "method StartStream not implemented")
    87  }
    88  
    89  // UnsafeGRPCBrokerServer may be embedded to opt out of forward compatibility for this service.
    90  // Use of this interface is not recommended, as added methods to GRPCBrokerServer will
    91  // result in compilation errors.
    92  type UnsafeGRPCBrokerServer interface {
    93  	mustEmbedUnimplementedGRPCBrokerServer()
    94  }
    95  
    96  func RegisterGRPCBrokerServer(s grpc.ServiceRegistrar, srv GRPCBrokerServer) {
    97  	s.RegisterService(&GRPCBroker_ServiceDesc, srv)
    98  }
    99  
   100  func _GRPCBroker_StartStream_Handler(srv interface{}, stream grpc.ServerStream) error {
   101  	return srv.(GRPCBrokerServer).StartStream(&gRPCBrokerStartStreamServer{stream})
   102  }
   103  
   104  type GRPCBroker_StartStreamServer interface {
   105  	Send(*ConnInfo) error
   106  	Recv() (*ConnInfo, error)
   107  	grpc.ServerStream
   108  }
   109  
   110  type gRPCBrokerStartStreamServer struct {
   111  	grpc.ServerStream
   112  }
   113  
   114  func (x *gRPCBrokerStartStreamServer) Send(m *ConnInfo) error {
   115  	return x.ServerStream.SendMsg(m)
   116  }
   117  
   118  func (x *gRPCBrokerStartStreamServer) Recv() (*ConnInfo, error) {
   119  	m := new(ConnInfo)
   120  	if err := x.ServerStream.RecvMsg(m); err != nil {
   121  		return nil, err
   122  	}
   123  	return m, nil
   124  }
   125  
   126  // GRPCBroker_ServiceDesc is the grpc.ServiceDesc for GRPCBroker service.
   127  // It's only intended for direct use with grpc.RegisterService,
   128  // and not to be introspected or modified (even as a copy)
   129  var GRPCBroker_ServiceDesc = grpc.ServiceDesc{
   130  	ServiceName: "plugin.GRPCBroker",
   131  	HandlerType: (*GRPCBrokerServer)(nil),
   132  	Methods:     []grpc.MethodDesc{},
   133  	Streams: []grpc.StreamDesc{
   134  		{
   135  			StreamName:    "StartStream",
   136  			Handler:       _GRPCBroker_StartStream_Handler,
   137  			ServerStreams: true,
   138  			ClientStreams: true,
   139  		},
   140  	},
   141  	Metadata: "internal/plugin/grpc_broker.proto",
   142  }