1// Code generated by protoc-gen-go. DO NOT EDIT. 2// source: grpc/grpc.proto 3 4package testing 5 6import ( 7 context "context" 8 fmt "fmt" 9 proto "github.com/golang/protobuf/proto" 10 grpc "google.golang.org/grpc" 11 math "math" 12) 13 14// Reference imports to suppress errors if they are not otherwise used. 15var _ = proto.Marshal 16var _ = fmt.Errorf 17var _ = math.Inf 18 19// This is a compile-time assertion to ensure that this generated file 20// is compatible with the proto package it is being compiled against. 21// A compilation error at this line likely means your copy of the 22// proto package needs to be updated. 23const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package 24 25type SimpleRequest struct { 26 XXX_NoUnkeyedLiteral struct{} `json:"-"` 27 XXX_unrecognized []byte `json:"-"` 28 XXX_sizecache int32 `json:"-"` 29} 30 31func (m *SimpleRequest) Reset() { *m = SimpleRequest{} } 32func (m *SimpleRequest) String() string { return proto.CompactTextString(m) } 33func (*SimpleRequest) ProtoMessage() {} 34func (*SimpleRequest) Descriptor() ([]byte, []int) { 35 return fileDescriptor_81ea47a3f88c2082, []int{0} 36} 37 38func (m *SimpleRequest) XXX_Unmarshal(b []byte) error { 39 return xxx_messageInfo_SimpleRequest.Unmarshal(m, b) 40} 41func (m *SimpleRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 42 return xxx_messageInfo_SimpleRequest.Marshal(b, m, deterministic) 43} 44func (m *SimpleRequest) XXX_Merge(src proto.Message) { 45 xxx_messageInfo_SimpleRequest.Merge(m, src) 46} 47func (m *SimpleRequest) XXX_Size() int { 48 return xxx_messageInfo_SimpleRequest.Size(m) 49} 50func (m *SimpleRequest) XXX_DiscardUnknown() { 51 xxx_messageInfo_SimpleRequest.DiscardUnknown(m) 52} 53 54var xxx_messageInfo_SimpleRequest proto.InternalMessageInfo 55 56type SimpleResponse struct { 57 XXX_NoUnkeyedLiteral struct{} `json:"-"` 58 XXX_unrecognized []byte `json:"-"` 59 XXX_sizecache int32 `json:"-"` 60} 61 62func (m *SimpleResponse) Reset() { *m = SimpleResponse{} } 63func (m *SimpleResponse) String() string { return proto.CompactTextString(m) } 64func (*SimpleResponse) ProtoMessage() {} 65func (*SimpleResponse) Descriptor() ([]byte, []int) { 66 return fileDescriptor_81ea47a3f88c2082, []int{1} 67} 68 69func (m *SimpleResponse) XXX_Unmarshal(b []byte) error { 70 return xxx_messageInfo_SimpleResponse.Unmarshal(m, b) 71} 72func (m *SimpleResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 73 return xxx_messageInfo_SimpleResponse.Marshal(b, m, deterministic) 74} 75func (m *SimpleResponse) XXX_Merge(src proto.Message) { 76 xxx_messageInfo_SimpleResponse.Merge(m, src) 77} 78func (m *SimpleResponse) XXX_Size() int { 79 return xxx_messageInfo_SimpleResponse.Size(m) 80} 81func (m *SimpleResponse) XXX_DiscardUnknown() { 82 xxx_messageInfo_SimpleResponse.DiscardUnknown(m) 83} 84 85var xxx_messageInfo_SimpleResponse proto.InternalMessageInfo 86 87type StreamMsg struct { 88 XXX_NoUnkeyedLiteral struct{} `json:"-"` 89 XXX_unrecognized []byte `json:"-"` 90 XXX_sizecache int32 `json:"-"` 91} 92 93func (m *StreamMsg) Reset() { *m = StreamMsg{} } 94func (m *StreamMsg) String() string { return proto.CompactTextString(m) } 95func (*StreamMsg) ProtoMessage() {} 96func (*StreamMsg) Descriptor() ([]byte, []int) { 97 return fileDescriptor_81ea47a3f88c2082, []int{2} 98} 99 100func (m *StreamMsg) XXX_Unmarshal(b []byte) error { 101 return xxx_messageInfo_StreamMsg.Unmarshal(m, b) 102} 103func (m *StreamMsg) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 104 return xxx_messageInfo_StreamMsg.Marshal(b, m, deterministic) 105} 106func (m *StreamMsg) XXX_Merge(src proto.Message) { 107 xxx_messageInfo_StreamMsg.Merge(m, src) 108} 109func (m *StreamMsg) XXX_Size() int { 110 return xxx_messageInfo_StreamMsg.Size(m) 111} 112func (m *StreamMsg) XXX_DiscardUnknown() { 113 xxx_messageInfo_StreamMsg.DiscardUnknown(m) 114} 115 116var xxx_messageInfo_StreamMsg proto.InternalMessageInfo 117 118type StreamMsg2 struct { 119 XXX_NoUnkeyedLiteral struct{} `json:"-"` 120 XXX_unrecognized []byte `json:"-"` 121 XXX_sizecache int32 `json:"-"` 122} 123 124func (m *StreamMsg2) Reset() { *m = StreamMsg2{} } 125func (m *StreamMsg2) String() string { return proto.CompactTextString(m) } 126func (*StreamMsg2) ProtoMessage() {} 127func (*StreamMsg2) Descriptor() ([]byte, []int) { 128 return fileDescriptor_81ea47a3f88c2082, []int{3} 129} 130 131func (m *StreamMsg2) XXX_Unmarshal(b []byte) error { 132 return xxx_messageInfo_StreamMsg2.Unmarshal(m, b) 133} 134func (m *StreamMsg2) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 135 return xxx_messageInfo_StreamMsg2.Marshal(b, m, deterministic) 136} 137func (m *StreamMsg2) XXX_Merge(src proto.Message) { 138 xxx_messageInfo_StreamMsg2.Merge(m, src) 139} 140func (m *StreamMsg2) XXX_Size() int { 141 return xxx_messageInfo_StreamMsg2.Size(m) 142} 143func (m *StreamMsg2) XXX_DiscardUnknown() { 144 xxx_messageInfo_StreamMsg2.DiscardUnknown(m) 145} 146 147var xxx_messageInfo_StreamMsg2 proto.InternalMessageInfo 148 149func init() { 150 proto.RegisterType((*SimpleRequest)(nil), "grpc.testing.SimpleRequest") 151 proto.RegisterType((*SimpleResponse)(nil), "grpc.testing.SimpleResponse") 152 proto.RegisterType((*StreamMsg)(nil), "grpc.testing.StreamMsg") 153 proto.RegisterType((*StreamMsg2)(nil), "grpc.testing.StreamMsg2") 154} 155 156func init() { proto.RegisterFile("grpc/grpc.proto", fileDescriptor_81ea47a3f88c2082) } 157 158var fileDescriptor_81ea47a3f88c2082 = []byte{ 159 // 244 bytes of a gzipped FileDescriptorProto 160 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0x2f, 0x2a, 0x48, 161 0xd6, 0x07, 0x11, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x3c, 0x60, 0x76, 0x49, 0x6a, 0x71, 162 0x49, 0x66, 0x5e, 0xba, 0x12, 0x3f, 0x17, 0x6f, 0x70, 0x66, 0x6e, 0x41, 0x4e, 0x6a, 0x50, 0x6a, 163 0x61, 0x69, 0x6a, 0x71, 0x89, 0x92, 0x00, 0x17, 0x1f, 0x4c, 0xa0, 0xb8, 0x20, 0x3f, 0xaf, 0x38, 164 0x55, 0x89, 0x9b, 0x8b, 0x33, 0xb8, 0xa4, 0x28, 0x35, 0x31, 0xd7, 0xb7, 0x38, 0x5d, 0x89, 0x87, 165 0x8b, 0x0b, 0xce, 0x31, 0x32, 0x9a, 0xc1, 0xc4, 0xc5, 0x12, 0x92, 0x5a, 0x5c, 0x22, 0xe4, 0xc6, 166 0xc5, 0x19, 0x9a, 0x97, 0x58, 0x54, 0xe9, 0x9c, 0x98, 0x93, 0x23, 0x24, 0xad, 0x87, 0x6c, 0x85, 167 0x1e, 0x8a, 0xf9, 0x52, 0x32, 0xd8, 0x25, 0x21, 0x76, 0x09, 0xb9, 0x70, 0x71, 0xb9, 0xe4, 0x97, 168 0xe7, 0x15, 0x83, 0xad, 0xc0, 0x6f, 0x90, 0x38, 0x9a, 0x24, 0xcc, 0x55, 0x06, 0x8c, 0x42, 0xce, 169 0x5c, 0x1c, 0xa1, 0x05, 0x50, 0x33, 0x70, 0x29, 0xc3, 0xef, 0x10, 0x0d, 0x46, 0x21, 0x5b, 0x2e, 170 0x16, 0xa7, 0xcc, 0x94, 0x4c, 0xdc, 0x06, 0x48, 0xe0, 0x90, 0x30, 0xd2, 0x60, 0x34, 0x60, 0x74, 171 0x72, 0x88, 0xb2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xcf, 172 0xcf, 0x49, 0xcc, 0x4b, 0xd7, 0x07, 0xc7, 0x40, 0x52, 0x69, 0x1a, 0x84, 0x91, 0xac, 0x9b, 0x9e, 173 0x9a, 0xa7, 0x9b, 0x9e, 0xaf, 0x0f, 0x32, 0x22, 0x25, 0xb1, 0x24, 0x11, 0x1c, 0x4d, 0xd6, 0x50, 174 0x03, 0x93, 0xd8, 0xc0, 0x8a, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x90, 0xb9, 0x95, 0x42, 175 0xc2, 0x01, 0x00, 0x00, 176} 177 178// Reference imports to suppress errors if they are not otherwise used. 179var _ context.Context 180var _ grpc.ClientConn 181 182// This is a compile-time assertion to ensure that this generated file 183// is compatible with the grpc package it is being compiled against. 184const _ = grpc.SupportPackageIsVersion4 185 186// TestClient is the client API for Test service. 187// 188// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 189type TestClient interface { 190 UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) 191 // This RPC streams from the server only. 192 Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) 193 // This RPC streams from the client. 194 Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) 195 // This one streams in both directions. 196 Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) 197} 198 199type testClient struct { 200 cc *grpc.ClientConn 201} 202 203func NewTestClient(cc *grpc.ClientConn) TestClient { 204 return &testClient{cc} 205} 206 207func (c *testClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { 208 out := new(SimpleResponse) 209 err := c.cc.Invoke(ctx, "/grpc.testing.Test/UnaryCall", in, out, opts...) 210 if err != nil { 211 return nil, err 212 } 213 return out, nil 214} 215 216func (c *testClient) Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) { 217 stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[0], "/grpc.testing.Test/Downstream", opts...) 218 if err != nil { 219 return nil, err 220 } 221 x := &testDownstreamClient{stream} 222 if err := x.ClientStream.SendMsg(in); err != nil { 223 return nil, err 224 } 225 if err := x.ClientStream.CloseSend(); err != nil { 226 return nil, err 227 } 228 return x, nil 229} 230 231type Test_DownstreamClient interface { 232 Recv() (*StreamMsg, error) 233 grpc.ClientStream 234} 235 236type testDownstreamClient struct { 237 grpc.ClientStream 238} 239 240func (x *testDownstreamClient) Recv() (*StreamMsg, error) { 241 m := new(StreamMsg) 242 if err := x.ClientStream.RecvMsg(m); err != nil { 243 return nil, err 244 } 245 return m, nil 246} 247 248func (c *testClient) Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) { 249 stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[1], "/grpc.testing.Test/Upstream", opts...) 250 if err != nil { 251 return nil, err 252 } 253 x := &testUpstreamClient{stream} 254 return x, nil 255} 256 257type Test_UpstreamClient interface { 258 Send(*StreamMsg) error 259 CloseAndRecv() (*SimpleResponse, error) 260 grpc.ClientStream 261} 262 263type testUpstreamClient struct { 264 grpc.ClientStream 265} 266 267func (x *testUpstreamClient) Send(m *StreamMsg) error { 268 return x.ClientStream.SendMsg(m) 269} 270 271func (x *testUpstreamClient) CloseAndRecv() (*SimpleResponse, error) { 272 if err := x.ClientStream.CloseSend(); err != nil { 273 return nil, err 274 } 275 m := new(SimpleResponse) 276 if err := x.ClientStream.RecvMsg(m); err != nil { 277 return nil, err 278 } 279 return m, nil 280} 281 282func (c *testClient) Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) { 283 stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[2], "/grpc.testing.Test/Bidi", opts...) 284 if err != nil { 285 return nil, err 286 } 287 x := &testBidiClient{stream} 288 return x, nil 289} 290 291type Test_BidiClient interface { 292 Send(*StreamMsg) error 293 Recv() (*StreamMsg2, error) 294 grpc.ClientStream 295} 296 297type testBidiClient struct { 298 grpc.ClientStream 299} 300 301func (x *testBidiClient) Send(m *StreamMsg) error { 302 return x.ClientStream.SendMsg(m) 303} 304 305func (x *testBidiClient) Recv() (*StreamMsg2, error) { 306 m := new(StreamMsg2) 307 if err := x.ClientStream.RecvMsg(m); err != nil { 308 return nil, err 309 } 310 return m, nil 311} 312 313// TestServer is the server API for Test service. 314type TestServer interface { 315 UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) 316 // This RPC streams from the server only. 317 Downstream(*SimpleRequest, Test_DownstreamServer) error 318 // This RPC streams from the client. 319 Upstream(Test_UpstreamServer) error 320 // This one streams in both directions. 321 Bidi(Test_BidiServer) error 322} 323 324func RegisterTestServer(s *grpc.Server, srv TestServer) { 325 s.RegisterService(&_Test_serviceDesc, srv) 326} 327 328func _Test_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 329 in := new(SimpleRequest) 330 if err := dec(in); err != nil { 331 return nil, err 332 } 333 if interceptor == nil { 334 return srv.(TestServer).UnaryCall(ctx, in) 335 } 336 info := &grpc.UnaryServerInfo{ 337 Server: srv, 338 FullMethod: "/grpc.testing.Test/UnaryCall", 339 } 340 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 341 return srv.(TestServer).UnaryCall(ctx, req.(*SimpleRequest)) 342 } 343 return interceptor(ctx, in, info, handler) 344} 345 346func _Test_Downstream_Handler(srv interface{}, stream grpc.ServerStream) error { 347 m := new(SimpleRequest) 348 if err := stream.RecvMsg(m); err != nil { 349 return err 350 } 351 return srv.(TestServer).Downstream(m, &testDownstreamServer{stream}) 352} 353 354type Test_DownstreamServer interface { 355 Send(*StreamMsg) error 356 grpc.ServerStream 357} 358 359type testDownstreamServer struct { 360 grpc.ServerStream 361} 362 363func (x *testDownstreamServer) Send(m *StreamMsg) error { 364 return x.ServerStream.SendMsg(m) 365} 366 367func _Test_Upstream_Handler(srv interface{}, stream grpc.ServerStream) error { 368 return srv.(TestServer).Upstream(&testUpstreamServer{stream}) 369} 370 371type Test_UpstreamServer interface { 372 SendAndClose(*SimpleResponse) error 373 Recv() (*StreamMsg, error) 374 grpc.ServerStream 375} 376 377type testUpstreamServer struct { 378 grpc.ServerStream 379} 380 381func (x *testUpstreamServer) SendAndClose(m *SimpleResponse) error { 382 return x.ServerStream.SendMsg(m) 383} 384 385func (x *testUpstreamServer) Recv() (*StreamMsg, error) { 386 m := new(StreamMsg) 387 if err := x.ServerStream.RecvMsg(m); err != nil { 388 return nil, err 389 } 390 return m, nil 391} 392 393func _Test_Bidi_Handler(srv interface{}, stream grpc.ServerStream) error { 394 return srv.(TestServer).Bidi(&testBidiServer{stream}) 395} 396 397type Test_BidiServer interface { 398 Send(*StreamMsg2) error 399 Recv() (*StreamMsg, error) 400 grpc.ServerStream 401} 402 403type testBidiServer struct { 404 grpc.ServerStream 405} 406 407func (x *testBidiServer) Send(m *StreamMsg2) error { 408 return x.ServerStream.SendMsg(m) 409} 410 411func (x *testBidiServer) Recv() (*StreamMsg, error) { 412 m := new(StreamMsg) 413 if err := x.ServerStream.RecvMsg(m); err != nil { 414 return nil, err 415 } 416 return m, nil 417} 418 419var _Test_serviceDesc = grpc.ServiceDesc{ 420 ServiceName: "grpc.testing.Test", 421 HandlerType: (*TestServer)(nil), 422 Methods: []grpc.MethodDesc{ 423 { 424 MethodName: "UnaryCall", 425 Handler: _Test_UnaryCall_Handler, 426 }, 427 }, 428 Streams: []grpc.StreamDesc{ 429 { 430 StreamName: "Downstream", 431 Handler: _Test_Downstream_Handler, 432 ServerStreams: true, 433 }, 434 { 435 StreamName: "Upstream", 436 Handler: _Test_Upstream_Handler, 437 ClientStreams: true, 438 }, 439 { 440 StreamName: "Bidi", 441 Handler: _Test_Bidi_Handler, 442 ServerStreams: true, 443 ClientStreams: true, 444 }, 445 }, 446 Metadata: "grpc/grpc.proto", 447} 448