github.com/Asutorufa/yuhaiin@v0.3.6-0.20240502055049-7984da7023a0/pkg/net/proxy/grpc/chunk_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 // versions: 3 // - protoc-gen-go-grpc v1.3.0 4 // - protoc v4.25.2 5 // source: chunk.proto 6 7 package grpc 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 wrapperspb "google.golang.org/protobuf/types/known/wrapperspb" 15 ) 16 17 // This is a compile-time assertion to ensure that this generated file 18 // is compatible with the grpc package it is being compiled against. 19 // Requires gRPC-Go v1.32.0 or later. 20 const _ = grpc.SupportPackageIsVersion7 21 22 const ( 23 Stream_Conn_FullMethodName = "/stream.stream/conn" 24 ) 25 26 // StreamClient is the client API for Stream service. 27 // 28 // 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. 29 type StreamClient interface { 30 Conn(ctx context.Context, opts ...grpc.CallOption) (Stream_ConnClient, error) 31 } 32 33 type streamClient struct { 34 cc grpc.ClientConnInterface 35 } 36 37 func NewStreamClient(cc grpc.ClientConnInterface) StreamClient { 38 return &streamClient{cc} 39 } 40 41 func (c *streamClient) Conn(ctx context.Context, opts ...grpc.CallOption) (Stream_ConnClient, error) { 42 stream, err := c.cc.NewStream(ctx, &Stream_ServiceDesc.Streams[0], Stream_Conn_FullMethodName, opts...) 43 if err != nil { 44 return nil, err 45 } 46 x := &streamConnClient{stream} 47 return x, nil 48 } 49 50 type Stream_ConnClient interface { 51 Send(*wrapperspb.BytesValue) error 52 Recv() (*wrapperspb.BytesValue, error) 53 grpc.ClientStream 54 } 55 56 type streamConnClient struct { 57 grpc.ClientStream 58 } 59 60 func (x *streamConnClient) Send(m *wrapperspb.BytesValue) error { 61 return x.ClientStream.SendMsg(m) 62 } 63 64 func (x *streamConnClient) Recv() (*wrapperspb.BytesValue, error) { 65 m := new(wrapperspb.BytesValue) 66 if err := x.ClientStream.RecvMsg(m); err != nil { 67 return nil, err 68 } 69 return m, nil 70 } 71 72 // StreamServer is the server API for Stream service. 73 // All implementations must embed UnimplementedStreamServer 74 // for forward compatibility 75 type StreamServer interface { 76 Conn(Stream_ConnServer) error 77 mustEmbedUnimplementedStreamServer() 78 } 79 80 // UnimplementedStreamServer must be embedded to have forward compatible implementations. 81 type UnimplementedStreamServer struct { 82 } 83 84 func (UnimplementedStreamServer) Conn(Stream_ConnServer) error { 85 return status.Errorf(codes.Unimplemented, "method Conn not implemented") 86 } 87 func (UnimplementedStreamServer) mustEmbedUnimplementedStreamServer() {} 88 89 // UnsafeStreamServer may be embedded to opt out of forward compatibility for this service. 90 // Use of this interface is not recommended, as added methods to StreamServer will 91 // result in compilation errors. 92 type UnsafeStreamServer interface { 93 mustEmbedUnimplementedStreamServer() 94 } 95 96 func RegisterStreamServer(s grpc.ServiceRegistrar, srv StreamServer) { 97 s.RegisterService(&Stream_ServiceDesc, srv) 98 } 99 100 func _Stream_Conn_Handler(srv interface{}, stream grpc.ServerStream) error { 101 return srv.(StreamServer).Conn(&streamConnServer{stream}) 102 } 103 104 type Stream_ConnServer interface { 105 Send(*wrapperspb.BytesValue) error 106 Recv() (*wrapperspb.BytesValue, error) 107 grpc.ServerStream 108 } 109 110 type streamConnServer struct { 111 grpc.ServerStream 112 } 113 114 func (x *streamConnServer) Send(m *wrapperspb.BytesValue) error { 115 return x.ServerStream.SendMsg(m) 116 } 117 118 func (x *streamConnServer) Recv() (*wrapperspb.BytesValue, error) { 119 m := new(wrapperspb.BytesValue) 120 if err := x.ServerStream.RecvMsg(m); err != nil { 121 return nil, err 122 } 123 return m, nil 124 } 125 126 // Stream_ServiceDesc is the grpc.ServiceDesc for Stream 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 Stream_ServiceDesc = grpc.ServiceDesc{ 130 ServiceName: "stream.stream", 131 HandlerType: (*StreamServer)(nil), 132 Methods: []grpc.MethodDesc{}, 133 Streams: []grpc.StreamDesc{ 134 { 135 StreamName: "conn", 136 Handler: _Stream_Conn_Handler, 137 ServerStreams: true, 138 ClientStreams: true, 139 }, 140 }, 141 Metadata: "chunk.proto", 142 }