| // Copyright 2020 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| |
| // Code generated by protoc-gen-go. DO NOT EDIT. |
| // versions: |
| // protoc-gen-go v1.19.0-devel |
| // protoc v3.11.3 |
| // source: grpc/grpc.proto |
| |
| package testing |
| |
| import ( |
| context "context" |
| grpc "google.golang.org/grpc" |
| codes "google.golang.org/grpc/codes" |
| status "google.golang.org/grpc/status" |
| protoreflect "google.golang.org/protobuf/reflect/protoreflect" |
| protoimpl "google.golang.org/protobuf/runtime/protoimpl" |
| reflect "reflect" |
| sync "sync" |
| ) |
| |
| const ( |
| // Verify that this generated code is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(19 - protoimpl.MinVersion) |
| // Verify that runtime/protoimpl is sufficiently up-to-date. |
| _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 19) |
| ) |
| |
| type SimpleRequest struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| } |
| |
| func (x *SimpleRequest) Reset() { |
| *x = SimpleRequest{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_grpc_grpc_proto_msgTypes[0] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *SimpleRequest) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*SimpleRequest) ProtoMessage() {} |
| |
| func (x *SimpleRequest) ProtoReflect() protoreflect.Message { |
| mi := &file_grpc_grpc_proto_msgTypes[0] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use SimpleRequest.ProtoReflect.Descriptor instead. |
| func (*SimpleRequest) Descriptor() ([]byte, []int) { |
| return file_grpc_grpc_proto_rawDescGZIP(), []int{0} |
| } |
| |
| type SimpleResponse struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| } |
| |
| func (x *SimpleResponse) Reset() { |
| *x = SimpleResponse{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_grpc_grpc_proto_msgTypes[1] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *SimpleResponse) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*SimpleResponse) ProtoMessage() {} |
| |
| func (x *SimpleResponse) ProtoReflect() protoreflect.Message { |
| mi := &file_grpc_grpc_proto_msgTypes[1] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use SimpleResponse.ProtoReflect.Descriptor instead. |
| func (*SimpleResponse) Descriptor() ([]byte, []int) { |
| return file_grpc_grpc_proto_rawDescGZIP(), []int{1} |
| } |
| |
| type StreamMsg struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| } |
| |
| func (x *StreamMsg) Reset() { |
| *x = StreamMsg{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_grpc_grpc_proto_msgTypes[2] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *StreamMsg) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*StreamMsg) ProtoMessage() {} |
| |
| func (x *StreamMsg) ProtoReflect() protoreflect.Message { |
| mi := &file_grpc_grpc_proto_msgTypes[2] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use StreamMsg.ProtoReflect.Descriptor instead. |
| func (*StreamMsg) Descriptor() ([]byte, []int) { |
| return file_grpc_grpc_proto_rawDescGZIP(), []int{2} |
| } |
| |
| type StreamMsg2 struct { |
| state protoimpl.MessageState |
| sizeCache protoimpl.SizeCache |
| unknownFields protoimpl.UnknownFields |
| } |
| |
| func (x *StreamMsg2) Reset() { |
| *x = StreamMsg2{} |
| if protoimpl.UnsafeEnabled { |
| mi := &file_grpc_grpc_proto_msgTypes[3] |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| ms.StoreMessageInfo(mi) |
| } |
| } |
| |
| func (x *StreamMsg2) String() string { |
| return protoimpl.X.MessageStringOf(x) |
| } |
| |
| func (*StreamMsg2) ProtoMessage() {} |
| |
| func (x *StreamMsg2) ProtoReflect() protoreflect.Message { |
| mi := &file_grpc_grpc_proto_msgTypes[3] |
| if protoimpl.UnsafeEnabled && x != nil { |
| ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) |
| if ms.LoadMessageInfo() == nil { |
| ms.StoreMessageInfo(mi) |
| } |
| return ms |
| } |
| return mi.MessageOf(x) |
| } |
| |
| // Deprecated: Use StreamMsg2.ProtoReflect.Descriptor instead. |
| func (*StreamMsg2) Descriptor() ([]byte, []int) { |
| return file_grpc_grpc_proto_rawDescGZIP(), []int{3} |
| } |
| |
| var File_grpc_grpc_proto protoreflect.FileDescriptor |
| |
| var file_grpc_grpc_proto_rawDesc = []byte{ |
| 0x0a, 0x0f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x70, 0x72, 0x6f, 0x74, |
| 0x6f, 0x12, 0x0c, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x22, |
| 0x0f, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, |
| 0x22, 0x10, 0x0a, 0x0e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, |
| 0x73, 0x65, 0x22, 0x0b, 0x0a, 0x09, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x73, 0x67, 0x22, |
| 0x0c, 0x0a, 0x0a, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x73, 0x67, 0x32, 0x32, 0x98, 0x02, |
| 0x0a, 0x04, 0x54, 0x65, 0x73, 0x74, 0x12, 0x46, 0x0a, 0x09, 0x55, 0x6e, 0x61, 0x72, 0x79, 0x43, |
| 0x61, 0x6c, 0x6c, 0x12, 0x1b, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, |
| 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, |
| 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, |
| 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, |
| 0x0a, 0x0a, 0x44, 0x6f, 0x77, 0x6e, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x12, 0x1b, 0x2e, 0x67, |
| 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, |
| 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, |
| 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, |
| 0x73, 0x67, 0x30, 0x01, 0x12, 0x43, 0x0a, 0x08, 0x55, 0x70, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d, |
| 0x12, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, |
| 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x73, 0x67, 0x1a, 0x1c, 0x2e, 0x67, 0x72, 0x70, 0x63, |
| 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x52, |
| 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x28, 0x01, 0x12, 0x3d, 0x0a, 0x04, 0x42, 0x69, 0x64, |
| 0x69, 0x12, 0x17, 0x2e, 0x67, 0x72, 0x70, 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, |
| 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, 0x4d, 0x73, 0x67, 0x1a, 0x18, 0x2e, 0x67, 0x72, 0x70, |
| 0x63, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x2e, 0x53, 0x74, 0x72, 0x65, 0x61, 0x6d, |
| 0x4d, 0x73, 0x67, 0x32, 0x28, 0x01, 0x30, 0x01, 0x42, 0x40, 0x5a, 0x3e, 0x67, 0x69, 0x74, 0x68, |
| 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, 0x6f, 0x6c, 0x61, 0x6e, 0x67, 0x2f, 0x70, 0x72, |
| 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, |
| 0x6e, 0x2d, 0x67, 0x6f, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x64, 0x61, 0x74, 0x61, 0x2f, 0x67, 0x72, |
| 0x70, 0x63, 0x3b, 0x74, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x67, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, |
| 0x6f, 0x33, |
| } |
| |
| var ( |
| file_grpc_grpc_proto_rawDescOnce sync.Once |
| file_grpc_grpc_proto_rawDescData = file_grpc_grpc_proto_rawDesc |
| ) |
| |
| func file_grpc_grpc_proto_rawDescGZIP() []byte { |
| file_grpc_grpc_proto_rawDescOnce.Do(func() { |
| file_grpc_grpc_proto_rawDescData = protoimpl.X.CompressGZIP(file_grpc_grpc_proto_rawDescData) |
| }) |
| return file_grpc_grpc_proto_rawDescData |
| } |
| |
| var file_grpc_grpc_proto_msgTypes = make([]protoimpl.MessageInfo, 4) |
| var file_grpc_grpc_proto_goTypes = []interface{}{ |
| (*SimpleRequest)(nil), // 0: grpc.testing.SimpleRequest |
| (*SimpleResponse)(nil), // 1: grpc.testing.SimpleResponse |
| (*StreamMsg)(nil), // 2: grpc.testing.StreamMsg |
| (*StreamMsg2)(nil), // 3: grpc.testing.StreamMsg2 |
| } |
| var file_grpc_grpc_proto_depIdxs = []int32{ |
| 0, // 0: grpc.testing.Test.UnaryCall:input_type -> grpc.testing.SimpleRequest |
| 0, // 1: grpc.testing.Test.Downstream:input_type -> grpc.testing.SimpleRequest |
| 2, // 2: grpc.testing.Test.Upstream:input_type -> grpc.testing.StreamMsg |
| 2, // 3: grpc.testing.Test.Bidi:input_type -> grpc.testing.StreamMsg |
| 1, // 4: grpc.testing.Test.UnaryCall:output_type -> grpc.testing.SimpleResponse |
| 2, // 5: grpc.testing.Test.Downstream:output_type -> grpc.testing.StreamMsg |
| 1, // 6: grpc.testing.Test.Upstream:output_type -> grpc.testing.SimpleResponse |
| 3, // 7: grpc.testing.Test.Bidi:output_type -> grpc.testing.StreamMsg2 |
| 4, // [4:8] is the sub-list for method output_type |
| 0, // [0:4] is the sub-list for method input_type |
| 0, // [0:0] is the sub-list for extension type_name |
| 0, // [0:0] is the sub-list for extension extendee |
| 0, // [0:0] is the sub-list for field type_name |
| } |
| |
| func init() { file_grpc_grpc_proto_init() } |
| func file_grpc_grpc_proto_init() { |
| if File_grpc_grpc_proto != nil { |
| return |
| } |
| if !protoimpl.UnsafeEnabled { |
| file_grpc_grpc_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*SimpleRequest); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_grpc_grpc_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*SimpleResponse); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_grpc_grpc_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*StreamMsg); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| file_grpc_grpc_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { |
| switch v := v.(*StreamMsg2); i { |
| case 0: |
| return &v.state |
| case 1: |
| return &v.sizeCache |
| case 2: |
| return &v.unknownFields |
| default: |
| return nil |
| } |
| } |
| } |
| type x struct{} |
| out := protoimpl.TypeBuilder{ |
| File: protoimpl.DescBuilder{ |
| GoPackagePath: reflect.TypeOf(x{}).PkgPath(), |
| RawDescriptor: file_grpc_grpc_proto_rawDesc, |
| NumEnums: 0, |
| NumMessages: 4, |
| NumExtensions: 0, |
| NumServices: 1, |
| }, |
| GoTypes: file_grpc_grpc_proto_goTypes, |
| DependencyIndexes: file_grpc_grpc_proto_depIdxs, |
| MessageInfos: file_grpc_grpc_proto_msgTypes, |
| }.Build() |
| File_grpc_grpc_proto = out.File |
| file_grpc_grpc_proto_rawDesc = nil |
| file_grpc_grpc_proto_goTypes = nil |
| file_grpc_grpc_proto_depIdxs = nil |
| } |
| |
| // Reference imports to suppress errors if they are not otherwise used. |
| var _ context.Context |
| var _ grpc.ClientConnInterface |
| |
| // This is a compile-time assertion to ensure that this generated file |
| // is compatible with the grpc package it is being compiled against. |
| const _ = grpc.SupportPackageIsVersion6 |
| |
| // TestClient is the client API for Test service. |
| // |
| // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. |
| type TestClient interface { |
| UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) |
| // This RPC streams from the server only. |
| Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) |
| // This RPC streams from the client. |
| Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) |
| // This one streams in both directions. |
| Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) |
| } |
| |
| type testClient struct { |
| cc grpc.ClientConnInterface |
| } |
| |
| func NewTestClient(cc grpc.ClientConnInterface) TestClient { |
| return &testClient{cc} |
| } |
| |
| func (c *testClient) UnaryCall(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (*SimpleResponse, error) { |
| out := new(SimpleResponse) |
| err := c.cc.Invoke(ctx, "/grpc.testing.Test/UnaryCall", in, out, opts...) |
| if err != nil { |
| return nil, err |
| } |
| return out, nil |
| } |
| |
| func (c *testClient) Downstream(ctx context.Context, in *SimpleRequest, opts ...grpc.CallOption) (Test_DownstreamClient, error) { |
| stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[0], "/grpc.testing.Test/Downstream", opts...) |
| if err != nil { |
| return nil, err |
| } |
| x := &testDownstreamClient{stream} |
| if err := x.ClientStream.SendMsg(in); err != nil { |
| return nil, err |
| } |
| if err := x.ClientStream.CloseSend(); err != nil { |
| return nil, err |
| } |
| return x, nil |
| } |
| |
| type Test_DownstreamClient interface { |
| Recv() (*StreamMsg, error) |
| grpc.ClientStream |
| } |
| |
| type testDownstreamClient struct { |
| grpc.ClientStream |
| } |
| |
| func (x *testDownstreamClient) Recv() (*StreamMsg, error) { |
| m := new(StreamMsg) |
| if err := x.ClientStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| func (c *testClient) Upstream(ctx context.Context, opts ...grpc.CallOption) (Test_UpstreamClient, error) { |
| stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[1], "/grpc.testing.Test/Upstream", opts...) |
| if err != nil { |
| return nil, err |
| } |
| x := &testUpstreamClient{stream} |
| return x, nil |
| } |
| |
| type Test_UpstreamClient interface { |
| Send(*StreamMsg) error |
| CloseAndRecv() (*SimpleResponse, error) |
| grpc.ClientStream |
| } |
| |
| type testUpstreamClient struct { |
| grpc.ClientStream |
| } |
| |
| func (x *testUpstreamClient) Send(m *StreamMsg) error { |
| return x.ClientStream.SendMsg(m) |
| } |
| |
| func (x *testUpstreamClient) CloseAndRecv() (*SimpleResponse, error) { |
| if err := x.ClientStream.CloseSend(); err != nil { |
| return nil, err |
| } |
| m := new(SimpleResponse) |
| if err := x.ClientStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| func (c *testClient) Bidi(ctx context.Context, opts ...grpc.CallOption) (Test_BidiClient, error) { |
| stream, err := c.cc.NewStream(ctx, &_Test_serviceDesc.Streams[2], "/grpc.testing.Test/Bidi", opts...) |
| if err != nil { |
| return nil, err |
| } |
| x := &testBidiClient{stream} |
| return x, nil |
| } |
| |
| type Test_BidiClient interface { |
| Send(*StreamMsg) error |
| Recv() (*StreamMsg2, error) |
| grpc.ClientStream |
| } |
| |
| type testBidiClient struct { |
| grpc.ClientStream |
| } |
| |
| func (x *testBidiClient) Send(m *StreamMsg) error { |
| return x.ClientStream.SendMsg(m) |
| } |
| |
| func (x *testBidiClient) Recv() (*StreamMsg2, error) { |
| m := new(StreamMsg2) |
| if err := x.ClientStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| // TestServer is the server API for Test service. |
| type TestServer interface { |
| UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) |
| // This RPC streams from the server only. |
| Downstream(*SimpleRequest, Test_DownstreamServer) error |
| // This RPC streams from the client. |
| Upstream(Test_UpstreamServer) error |
| // This one streams in both directions. |
| Bidi(Test_BidiServer) error |
| } |
| |
| // UnimplementedTestServer can be embedded to have forward compatible implementations. |
| type UnimplementedTestServer struct { |
| } |
| |
| func (*UnimplementedTestServer) UnaryCall(context.Context, *SimpleRequest) (*SimpleResponse, error) { |
| return nil, status.Errorf(codes.Unimplemented, "method UnaryCall not implemented") |
| } |
| func (*UnimplementedTestServer) Downstream(*SimpleRequest, Test_DownstreamServer) error { |
| return status.Errorf(codes.Unimplemented, "method Downstream not implemented") |
| } |
| func (*UnimplementedTestServer) Upstream(Test_UpstreamServer) error { |
| return status.Errorf(codes.Unimplemented, "method Upstream not implemented") |
| } |
| func (*UnimplementedTestServer) Bidi(Test_BidiServer) error { |
| return status.Errorf(codes.Unimplemented, "method Bidi not implemented") |
| } |
| |
| func RegisterTestServer(s *grpc.Server, srv TestServer) { |
| s.RegisterService(&_Test_serviceDesc, srv) |
| } |
| |
| func _Test_UnaryCall_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { |
| in := new(SimpleRequest) |
| if err := dec(in); err != nil { |
| return nil, err |
| } |
| if interceptor == nil { |
| return srv.(TestServer).UnaryCall(ctx, in) |
| } |
| info := &grpc.UnaryServerInfo{ |
| Server: srv, |
| FullMethod: "/grpc.testing.Test/UnaryCall", |
| } |
| handler := func(ctx context.Context, req interface{}) (interface{}, error) { |
| return srv.(TestServer).UnaryCall(ctx, req.(*SimpleRequest)) |
| } |
| return interceptor(ctx, in, info, handler) |
| } |
| |
| func _Test_Downstream_Handler(srv interface{}, stream grpc.ServerStream) error { |
| m := new(SimpleRequest) |
| if err := stream.RecvMsg(m); err != nil { |
| return err |
| } |
| return srv.(TestServer).Downstream(m, &testDownstreamServer{stream}) |
| } |
| |
| type Test_DownstreamServer interface { |
| Send(*StreamMsg) error |
| grpc.ServerStream |
| } |
| |
| type testDownstreamServer struct { |
| grpc.ServerStream |
| } |
| |
| func (x *testDownstreamServer) Send(m *StreamMsg) error { |
| return x.ServerStream.SendMsg(m) |
| } |
| |
| func _Test_Upstream_Handler(srv interface{}, stream grpc.ServerStream) error { |
| return srv.(TestServer).Upstream(&testUpstreamServer{stream}) |
| } |
| |
| type Test_UpstreamServer interface { |
| SendAndClose(*SimpleResponse) error |
| Recv() (*StreamMsg, error) |
| grpc.ServerStream |
| } |
| |
| type testUpstreamServer struct { |
| grpc.ServerStream |
| } |
| |
| func (x *testUpstreamServer) SendAndClose(m *SimpleResponse) error { |
| return x.ServerStream.SendMsg(m) |
| } |
| |
| func (x *testUpstreamServer) Recv() (*StreamMsg, error) { |
| m := new(StreamMsg) |
| if err := x.ServerStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| func _Test_Bidi_Handler(srv interface{}, stream grpc.ServerStream) error { |
| return srv.(TestServer).Bidi(&testBidiServer{stream}) |
| } |
| |
| type Test_BidiServer interface { |
| Send(*StreamMsg2) error |
| Recv() (*StreamMsg, error) |
| grpc.ServerStream |
| } |
| |
| type testBidiServer struct { |
| grpc.ServerStream |
| } |
| |
| func (x *testBidiServer) Send(m *StreamMsg2) error { |
| return x.ServerStream.SendMsg(m) |
| } |
| |
| func (x *testBidiServer) Recv() (*StreamMsg, error) { |
| m := new(StreamMsg) |
| if err := x.ServerStream.RecvMsg(m); err != nil { |
| return nil, err |
| } |
| return m, nil |
| } |
| |
| var _Test_serviceDesc = grpc.ServiceDesc{ |
| ServiceName: "grpc.testing.Test", |
| HandlerType: (*TestServer)(nil), |
| Methods: []grpc.MethodDesc{ |
| { |
| MethodName: "UnaryCall", |
| Handler: _Test_UnaryCall_Handler, |
| }, |
| }, |
| Streams: []grpc.StreamDesc{ |
| { |
| StreamName: "Downstream", |
| Handler: _Test_Downstream_Handler, |
| ServerStreams: true, |
| }, |
| { |
| StreamName: "Upstream", |
| Handler: _Test_Upstream_Handler, |
| ClientStreams: true, |
| }, |
| { |
| StreamName: "Bidi", |
| Handler: _Test_Bidi_Handler, |
| ServerStreams: true, |
| ClientStreams: true, |
| }, |
| }, |
| Metadata: "grpc/grpc.proto", |
| } |