github.com/eagleql/xray-core@v1.4.4/transport/internet/grpc/encoding/stream_grpc.pb.go (about) 1 // Code generated by protoc-gen-go-grpc. DO NOT EDIT. 2 3 package encoding 4 5 import ( 6 context "context" 7 grpc "google.golang.org/grpc" 8 codes "google.golang.org/grpc/codes" 9 status "google.golang.org/grpc/status" 10 ) 11 12 // This is a compile-time assertion to ensure that this generated file 13 // is compatible with the grpc package it is being compiled against. 14 // Requires gRPC-Go v1.32.0 or later. 15 const _ = grpc.SupportPackageIsVersion7 16 17 // GRPCServiceClient is the client API for GRPCService service. 18 // 19 // 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. 20 type GRPCServiceClient interface { 21 Tun(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunClient, error) 22 TunMulti(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error) 23 } 24 25 type gRPCServiceClient struct { 26 cc grpc.ClientConnInterface 27 } 28 29 func NewGRPCServiceClient(cc grpc.ClientConnInterface) GRPCServiceClient { 30 return &gRPCServiceClient{cc} 31 } 32 33 func (c *gRPCServiceClient) Tun(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunClient, error) { 34 stream, err := c.cc.NewStream(ctx, &GRPCService_ServiceDesc.Streams[0], "/xray.transport.internet.grpc.encoding.GRPCService/Tun", opts...) 35 if err != nil { 36 return nil, err 37 } 38 x := &gRPCServiceTunClient{stream} 39 return x, nil 40 } 41 42 type GRPCService_TunClient interface { 43 Send(*Hunk) error 44 Recv() (*Hunk, error) 45 grpc.ClientStream 46 } 47 48 type gRPCServiceTunClient struct { 49 grpc.ClientStream 50 } 51 52 func (x *gRPCServiceTunClient) Send(m *Hunk) error { 53 return x.ClientStream.SendMsg(m) 54 } 55 56 func (x *gRPCServiceTunClient) Recv() (*Hunk, error) { 57 m := new(Hunk) 58 if err := x.ClientStream.RecvMsg(m); err != nil { 59 return nil, err 60 } 61 return m, nil 62 } 63 64 func (c *gRPCServiceClient) TunMulti(ctx context.Context, opts ...grpc.CallOption) (GRPCService_TunMultiClient, error) { 65 stream, err := c.cc.NewStream(ctx, &GRPCService_ServiceDesc.Streams[1], "/xray.transport.internet.grpc.encoding.GRPCService/TunMulti", opts...) 66 if err != nil { 67 return nil, err 68 } 69 x := &gRPCServiceTunMultiClient{stream} 70 return x, nil 71 } 72 73 type GRPCService_TunMultiClient interface { 74 Send(*MultiHunk) error 75 Recv() (*MultiHunk, error) 76 grpc.ClientStream 77 } 78 79 type gRPCServiceTunMultiClient struct { 80 grpc.ClientStream 81 } 82 83 func (x *gRPCServiceTunMultiClient) Send(m *MultiHunk) error { 84 return x.ClientStream.SendMsg(m) 85 } 86 87 func (x *gRPCServiceTunMultiClient) Recv() (*MultiHunk, error) { 88 m := new(MultiHunk) 89 if err := x.ClientStream.RecvMsg(m); err != nil { 90 return nil, err 91 } 92 return m, nil 93 } 94 95 // GRPCServiceServer is the server API for GRPCService service. 96 // All implementations must embed UnimplementedGRPCServiceServer 97 // for forward compatibility 98 type GRPCServiceServer interface { 99 Tun(GRPCService_TunServer) error 100 TunMulti(GRPCService_TunMultiServer) error 101 mustEmbedUnimplementedGRPCServiceServer() 102 } 103 104 // UnimplementedGRPCServiceServer must be embedded to have forward compatible implementations. 105 type UnimplementedGRPCServiceServer struct { 106 } 107 108 func (UnimplementedGRPCServiceServer) Tun(GRPCService_TunServer) error { 109 return status.Errorf(codes.Unimplemented, "method Tun not implemented") 110 } 111 func (UnimplementedGRPCServiceServer) TunMulti(GRPCService_TunMultiServer) error { 112 return status.Errorf(codes.Unimplemented, "method TunMulti not implemented") 113 } 114 func (UnimplementedGRPCServiceServer) mustEmbedUnimplementedGRPCServiceServer() {} 115 116 // UnsafeGRPCServiceServer may be embedded to opt out of forward compatibility for this service. 117 // Use of this interface is not recommended, as added methods to GRPCServiceServer will 118 // result in compilation errors. 119 type UnsafeGRPCServiceServer interface { 120 mustEmbedUnimplementedGRPCServiceServer() 121 } 122 123 func RegisterGRPCServiceServer(s grpc.ServiceRegistrar, srv GRPCServiceServer) { 124 s.RegisterService(&GRPCService_ServiceDesc, srv) 125 } 126 127 func _GRPCService_Tun_Handler(srv interface{}, stream grpc.ServerStream) error { 128 return srv.(GRPCServiceServer).Tun(&gRPCServiceTunServer{stream}) 129 } 130 131 type GRPCService_TunServer interface { 132 Send(*Hunk) error 133 Recv() (*Hunk, error) 134 grpc.ServerStream 135 } 136 137 type gRPCServiceTunServer struct { 138 grpc.ServerStream 139 } 140 141 func (x *gRPCServiceTunServer) Send(m *Hunk) error { 142 return x.ServerStream.SendMsg(m) 143 } 144 145 func (x *gRPCServiceTunServer) Recv() (*Hunk, error) { 146 m := new(Hunk) 147 if err := x.ServerStream.RecvMsg(m); err != nil { 148 return nil, err 149 } 150 return m, nil 151 } 152 153 func _GRPCService_TunMulti_Handler(srv interface{}, stream grpc.ServerStream) error { 154 return srv.(GRPCServiceServer).TunMulti(&gRPCServiceTunMultiServer{stream}) 155 } 156 157 type GRPCService_TunMultiServer interface { 158 Send(*MultiHunk) error 159 Recv() (*MultiHunk, error) 160 grpc.ServerStream 161 } 162 163 type gRPCServiceTunMultiServer struct { 164 grpc.ServerStream 165 } 166 167 func (x *gRPCServiceTunMultiServer) Send(m *MultiHunk) error { 168 return x.ServerStream.SendMsg(m) 169 } 170 171 func (x *gRPCServiceTunMultiServer) Recv() (*MultiHunk, error) { 172 m := new(MultiHunk) 173 if err := x.ServerStream.RecvMsg(m); err != nil { 174 return nil, err 175 } 176 return m, nil 177 } 178 179 // GRPCService_ServiceDesc is the grpc.ServiceDesc for GRPCService service. 180 // It's only intended for direct use with grpc.RegisterService, 181 // and not to be introspected or modified (even as a copy) 182 var GRPCService_ServiceDesc = grpc.ServiceDesc{ 183 ServiceName: "xray.transport.internet.grpc.encoding.GRPCService", 184 HandlerType: (*GRPCServiceServer)(nil), 185 Methods: []grpc.MethodDesc{}, 186 Streams: []grpc.StreamDesc{ 187 { 188 StreamName: "Tun", 189 Handler: _GRPCService_Tun_Handler, 190 ServerStreams: true, 191 ClientStreams: true, 192 }, 193 { 194 StreamName: "TunMulti", 195 Handler: _GRPCService_TunMulti_Handler, 196 ServerStreams: true, 197 ClientStreams: true, 198 }, 199 }, 200 Metadata: "transport/internet/grpc/encoding/stream.proto", 201 }