github.com/laof/lite-speed-test@v0.0.0-20230930011949-1f39b7037845/api/rpc/lite/lite_grpc.pb.go (about)

     1  // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
     2  // versions:
     3  // - protoc-gen-go-grpc v1.2.0
     4  // - protoc             v3.21.5
     5  // source: lite.proto
     6  
     7  package lite
     8  
     9  import (
    10  	context "context"
    11  	grpc "google.golang.org/grpc"
    12  	codes "google.golang.org/grpc/codes"
    13  	status "google.golang.org/grpc/status"
    14  )
    15  
    16  // This is a compile-time assertion to ensure that this generated file
    17  // is compatible with the grpc package it is being compiled against.
    18  // Requires gRPC-Go v1.32.0 or later.
    19  const _ = grpc.SupportPackageIsVersion7
    20  
    21  // TestProxyClient is the client API for TestProxy service.
    22  //
    23  // 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.
    24  type TestProxyClient interface {
    25  	StartTest(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (TestProxy_StartTestClient, error)
    26  }
    27  
    28  type testProxyClient struct {
    29  	cc grpc.ClientConnInterface
    30  }
    31  
    32  func NewTestProxyClient(cc grpc.ClientConnInterface) TestProxyClient {
    33  	return &testProxyClient{cc}
    34  }
    35  
    36  func (c *testProxyClient) StartTest(ctx context.Context, in *TestRequest, opts ...grpc.CallOption) (TestProxy_StartTestClient, error) {
    37  	stream, err := c.cc.NewStream(ctx, &TestProxy_ServiceDesc.Streams[0], "/liteproxy.TestProxy/StartTest", opts...)
    38  	if err != nil {
    39  		return nil, err
    40  	}
    41  	x := &testProxyStartTestClient{stream}
    42  	if err := x.ClientStream.SendMsg(in); err != nil {
    43  		return nil, err
    44  	}
    45  	if err := x.ClientStream.CloseSend(); err != nil {
    46  		return nil, err
    47  	}
    48  	return x, nil
    49  }
    50  
    51  type TestProxy_StartTestClient interface {
    52  	Recv() (*TestReply, error)
    53  	grpc.ClientStream
    54  }
    55  
    56  type testProxyStartTestClient struct {
    57  	grpc.ClientStream
    58  }
    59  
    60  func (x *testProxyStartTestClient) Recv() (*TestReply, error) {
    61  	m := new(TestReply)
    62  	if err := x.ClientStream.RecvMsg(m); err != nil {
    63  		return nil, err
    64  	}
    65  	return m, nil
    66  }
    67  
    68  // TestProxyServer is the server API for TestProxy service.
    69  // All implementations must embed UnimplementedTestProxyServer
    70  // for forward compatibility
    71  type TestProxyServer interface {
    72  	StartTest(*TestRequest, TestProxy_StartTestServer) error
    73  	mustEmbedUnimplementedTestProxyServer()
    74  }
    75  
    76  // UnimplementedTestProxyServer must be embedded to have forward compatible implementations.
    77  type UnimplementedTestProxyServer struct {
    78  }
    79  
    80  func (UnimplementedTestProxyServer) StartTest(*TestRequest, TestProxy_StartTestServer) error {
    81  	return status.Errorf(codes.Unimplemented, "method StartTest not implemented")
    82  }
    83  func (UnimplementedTestProxyServer) mustEmbedUnimplementedTestProxyServer() {}
    84  
    85  // UnsafeTestProxyServer may be embedded to opt out of forward compatibility for this service.
    86  // Use of this interface is not recommended, as added methods to TestProxyServer will
    87  // result in compilation errors.
    88  type UnsafeTestProxyServer interface {
    89  	mustEmbedUnimplementedTestProxyServer()
    90  }
    91  
    92  func RegisterTestProxyServer(s grpc.ServiceRegistrar, srv TestProxyServer) {
    93  	s.RegisterService(&TestProxy_ServiceDesc, srv)
    94  }
    95  
    96  func _TestProxy_StartTest_Handler(srv interface{}, stream grpc.ServerStream) error {
    97  	m := new(TestRequest)
    98  	if err := stream.RecvMsg(m); err != nil {
    99  		return err
   100  	}
   101  	return srv.(TestProxyServer).StartTest(m, &testProxyStartTestServer{stream})
   102  }
   103  
   104  type TestProxy_StartTestServer interface {
   105  	Send(*TestReply) error
   106  	grpc.ServerStream
   107  }
   108  
   109  type testProxyStartTestServer struct {
   110  	grpc.ServerStream
   111  }
   112  
   113  func (x *testProxyStartTestServer) Send(m *TestReply) error {
   114  	return x.ServerStream.SendMsg(m)
   115  }
   116  
   117  // TestProxy_ServiceDesc is the grpc.ServiceDesc for TestProxy service.
   118  // It's only intended for direct use with grpc.RegisterService,
   119  // and not to be introspected or modified (even as a copy)
   120  var TestProxy_ServiceDesc = grpc.ServiceDesc{
   121  	ServiceName: "liteproxy.TestProxy",
   122  	HandlerType: (*TestProxyServer)(nil),
   123  	Methods:     []grpc.MethodDesc{},
   124  	Streams: []grpc.StreamDesc{
   125  		{
   126  			StreamName:    "StartTest",
   127  			Handler:       _TestProxy_StartTest_Handler,
   128  			ServerStreams: true,
   129  		},
   130  	},
   131  	Metadata: "lite.proto",
   132  }