go.chromium.org/luci@v0.0.0-20240309015107-7cdc2e660f33/grpc/prpc/helloworld_test.pb_test.go (about) 1 // Copyright 2016 The LUCI Authors. All rights reserved. 2 // Use of this source code is governed under the Apache License, Version 2.0 3 // that can be found in the LICENSE file. 4 5 // Code generated by protoc-gen-go. DO NOT EDIT. 6 // versions: 7 // protoc-gen-go v1.31.0 8 // protoc v3.21.7 9 // source: go.chromium.org/luci/grpc/prpc/helloworld_test.proto 10 11 package prpc 12 13 import ( 14 context "context" 15 grpc "google.golang.org/grpc" 16 codes "google.golang.org/grpc/codes" 17 status "google.golang.org/grpc/status" 18 protoreflect "google.golang.org/protobuf/reflect/protoreflect" 19 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 20 fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb" 21 reflect "reflect" 22 sync "sync" 23 ) 24 25 const ( 26 // Verify that this generated code is sufficiently up-to-date. 27 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 28 // Verify that runtime/protoimpl is sufficiently up-to-date. 29 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 30 ) 31 32 // The request message containing the user's name. 33 type HelloRequest struct { 34 state protoimpl.MessageState 35 sizeCache protoimpl.SizeCache 36 unknownFields protoimpl.UnknownFields 37 38 Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` 39 Fields *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=fields,proto3" json:"fields,omitempty"` 40 } 41 42 func (x *HelloRequest) Reset() { 43 *x = HelloRequest{} 44 if protoimpl.UnsafeEnabled { 45 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[0] 46 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 47 ms.StoreMessageInfo(mi) 48 } 49 } 50 51 func (x *HelloRequest) String() string { 52 return protoimpl.X.MessageStringOf(x) 53 } 54 55 func (*HelloRequest) ProtoMessage() {} 56 57 func (x *HelloRequest) ProtoReflect() protoreflect.Message { 58 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[0] 59 if protoimpl.UnsafeEnabled && x != nil { 60 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 61 if ms.LoadMessageInfo() == nil { 62 ms.StoreMessageInfo(mi) 63 } 64 return ms 65 } 66 return mi.MessageOf(x) 67 } 68 69 // Deprecated: Use HelloRequest.ProtoReflect.Descriptor instead. 70 func (*HelloRequest) Descriptor() ([]byte, []int) { 71 return file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescGZIP(), []int{0} 72 } 73 74 func (x *HelloRequest) GetName() string { 75 if x != nil { 76 return x.Name 77 } 78 return "" 79 } 80 81 func (x *HelloRequest) GetFields() *fieldmaskpb.FieldMask { 82 if x != nil { 83 return x.Fields 84 } 85 return nil 86 } 87 88 // The response message containing the greetings 89 type HelloReply struct { 90 state protoimpl.MessageState 91 sizeCache protoimpl.SizeCache 92 unknownFields protoimpl.UnknownFields 93 94 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 95 } 96 97 func (x *HelloReply) Reset() { 98 *x = HelloReply{} 99 if protoimpl.UnsafeEnabled { 100 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[1] 101 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 102 ms.StoreMessageInfo(mi) 103 } 104 } 105 106 func (x *HelloReply) String() string { 107 return protoimpl.X.MessageStringOf(x) 108 } 109 110 func (*HelloReply) ProtoMessage() {} 111 112 func (x *HelloReply) ProtoReflect() protoreflect.Message { 113 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[1] 114 if protoimpl.UnsafeEnabled && x != nil { 115 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 116 if ms.LoadMessageInfo() == nil { 117 ms.StoreMessageInfo(mi) 118 } 119 return ms 120 } 121 return mi.MessageOf(x) 122 } 123 124 // Deprecated: Use HelloReply.ProtoReflect.Descriptor instead. 125 func (*HelloReply) Descriptor() ([]byte, []int) { 126 return file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescGZIP(), []int{1} 127 } 128 129 func (x *HelloReply) GetMessage() string { 130 if x != nil { 131 return x.Message 132 } 133 return "" 134 } 135 136 type MultiplyRequest struct { 137 state protoimpl.MessageState 138 sizeCache protoimpl.SizeCache 139 unknownFields protoimpl.UnknownFields 140 141 X int32 `protobuf:"varint,1,opt,name=x,proto3" json:"x,omitempty"` 142 Y int32 `protobuf:"varint,2,opt,name=y,proto3" json:"y,omitempty"` 143 } 144 145 func (x *MultiplyRequest) Reset() { 146 *x = MultiplyRequest{} 147 if protoimpl.UnsafeEnabled { 148 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[2] 149 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 150 ms.StoreMessageInfo(mi) 151 } 152 } 153 154 func (x *MultiplyRequest) String() string { 155 return protoimpl.X.MessageStringOf(x) 156 } 157 158 func (*MultiplyRequest) ProtoMessage() {} 159 160 func (x *MultiplyRequest) ProtoReflect() protoreflect.Message { 161 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[2] 162 if protoimpl.UnsafeEnabled && x != nil { 163 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 164 if ms.LoadMessageInfo() == nil { 165 ms.StoreMessageInfo(mi) 166 } 167 return ms 168 } 169 return mi.MessageOf(x) 170 } 171 172 // Deprecated: Use MultiplyRequest.ProtoReflect.Descriptor instead. 173 func (*MultiplyRequest) Descriptor() ([]byte, []int) { 174 return file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescGZIP(), []int{2} 175 } 176 177 func (x *MultiplyRequest) GetX() int32 { 178 if x != nil { 179 return x.X 180 } 181 return 0 182 } 183 184 func (x *MultiplyRequest) GetY() int32 { 185 if x != nil { 186 return x.Y 187 } 188 return 0 189 } 190 191 type MultiplyResponse struct { 192 state protoimpl.MessageState 193 sizeCache protoimpl.SizeCache 194 unknownFields protoimpl.UnknownFields 195 196 Z int32 `protobuf:"varint,1,opt,name=z,proto3" json:"z,omitempty"` 197 } 198 199 func (x *MultiplyResponse) Reset() { 200 *x = MultiplyResponse{} 201 if protoimpl.UnsafeEnabled { 202 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[3] 203 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 204 ms.StoreMessageInfo(mi) 205 } 206 } 207 208 func (x *MultiplyResponse) String() string { 209 return protoimpl.X.MessageStringOf(x) 210 } 211 212 func (*MultiplyResponse) ProtoMessage() {} 213 214 func (x *MultiplyResponse) ProtoReflect() protoreflect.Message { 215 mi := &file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[3] 216 if protoimpl.UnsafeEnabled && x != nil { 217 ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) 218 if ms.LoadMessageInfo() == nil { 219 ms.StoreMessageInfo(mi) 220 } 221 return ms 222 } 223 return mi.MessageOf(x) 224 } 225 226 // Deprecated: Use MultiplyResponse.ProtoReflect.Descriptor instead. 227 func (*MultiplyResponse) Descriptor() ([]byte, []int) { 228 return file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescGZIP(), []int{3} 229 } 230 231 func (x *MultiplyResponse) GetZ() int32 { 232 if x != nil { 233 return x.Z 234 } 235 return 0 236 } 237 238 var File_go_chromium_org_luci_grpc_prpc_helloworld_test_proto protoreflect.FileDescriptor 239 240 var file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDesc = []byte{ 241 0x0a, 0x34, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 242 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x70, 0x63, 243 0x2f, 0x68, 0x65, 0x6c, 0x6c, 0x6f, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f, 0x74, 0x65, 0x73, 0x74, 244 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x04, 0x70, 0x72, 0x70, 0x63, 0x1a, 0x20, 0x67, 0x6f, 245 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 246 0x65, 0x6c, 0x64, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x56, 247 0x0a, 0x0c, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 248 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 249 0x6d, 0x65, 0x12, 0x32, 0x0a, 0x06, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x02, 0x20, 0x01, 250 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 251 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b, 0x52, 0x06, 252 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x22, 0x26, 0x0a, 0x0a, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 253 0x65, 0x70, 0x6c, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 254 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x2d, 255 0x0a, 0x0f, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 256 0x74, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x78, 0x12, 257 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x79, 0x22, 0x20, 0x0a, 258 0x10, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 259 0x65, 0x12, 0x0c, 0x0a, 0x01, 0x7a, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x01, 0x7a, 0x32, 260 0x3d, 0x0a, 0x07, 0x47, 0x72, 0x65, 0x65, 0x74, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x08, 0x53, 0x61, 261 0x79, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x12, 0x12, 0x2e, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x48, 0x65, 262 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x70, 263 0x63, 0x2e, 0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x52, 0x65, 0x70, 0x6c, 0x79, 0x22, 0x00, 0x32, 0x43, 264 0x0a, 0x04, 0x43, 0x61, 0x6c, 0x63, 0x12, 0x3b, 0x0a, 0x08, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 265 0x6c, 0x79, 0x12, 0x15, 0x2e, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 266 0x6c, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x70, 0x63, 267 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 268 0x65, 0x22, 0x00, 0x42, 0x20, 0x5a, 0x1e, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 269 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63, 270 0x2f, 0x70, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 271 } 272 273 var ( 274 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescOnce sync.Once 275 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescData = file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDesc 276 ) 277 278 func file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescGZIP() []byte { 279 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescOnce.Do(func() { 280 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescData) 281 }) 282 return file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDescData 283 } 284 285 var file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 286 var file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_goTypes = []interface{}{ 287 (*HelloRequest)(nil), // 0: prpc.HelloRequest 288 (*HelloReply)(nil), // 1: prpc.HelloReply 289 (*MultiplyRequest)(nil), // 2: prpc.MultiplyRequest 290 (*MultiplyResponse)(nil), // 3: prpc.MultiplyResponse 291 (*fieldmaskpb.FieldMask)(nil), // 4: google.protobuf.FieldMask 292 } 293 var file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_depIdxs = []int32{ 294 4, // 0: prpc.HelloRequest.fields:type_name -> google.protobuf.FieldMask 295 0, // 1: prpc.Greeter.SayHello:input_type -> prpc.HelloRequest 296 2, // 2: prpc.Calc.Multiply:input_type -> prpc.MultiplyRequest 297 1, // 3: prpc.Greeter.SayHello:output_type -> prpc.HelloReply 298 3, // 4: prpc.Calc.Multiply:output_type -> prpc.MultiplyResponse 299 3, // [3:5] is the sub-list for method output_type 300 1, // [1:3] is the sub-list for method input_type 301 1, // [1:1] is the sub-list for extension type_name 302 1, // [1:1] is the sub-list for extension extendee 303 0, // [0:1] is the sub-list for field type_name 304 } 305 306 func init() { file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_init() } 307 func file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_init() { 308 if File_go_chromium_org_luci_grpc_prpc_helloworld_test_proto != nil { 309 return 310 } 311 if !protoimpl.UnsafeEnabled { 312 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { 313 switch v := v.(*HelloRequest); i { 314 case 0: 315 return &v.state 316 case 1: 317 return &v.sizeCache 318 case 2: 319 return &v.unknownFields 320 default: 321 return nil 322 } 323 } 324 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { 325 switch v := v.(*HelloReply); i { 326 case 0: 327 return &v.state 328 case 1: 329 return &v.sizeCache 330 case 2: 331 return &v.unknownFields 332 default: 333 return nil 334 } 335 } 336 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { 337 switch v := v.(*MultiplyRequest); i { 338 case 0: 339 return &v.state 340 case 1: 341 return &v.sizeCache 342 case 2: 343 return &v.unknownFields 344 default: 345 return nil 346 } 347 } 348 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { 349 switch v := v.(*MultiplyResponse); i { 350 case 0: 351 return &v.state 352 case 1: 353 return &v.sizeCache 354 case 2: 355 return &v.unknownFields 356 default: 357 return nil 358 } 359 } 360 } 361 type x struct{} 362 out := protoimpl.TypeBuilder{ 363 File: protoimpl.DescBuilder{ 364 GoPackagePath: reflect.TypeOf(x{}).PkgPath(), 365 RawDescriptor: file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDesc, 366 NumEnums: 0, 367 NumMessages: 4, 368 NumExtensions: 0, 369 NumServices: 2, 370 }, 371 GoTypes: file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_goTypes, 372 DependencyIndexes: file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_depIdxs, 373 MessageInfos: file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_msgTypes, 374 }.Build() 375 File_go_chromium_org_luci_grpc_prpc_helloworld_test_proto = out.File 376 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_rawDesc = nil 377 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_goTypes = nil 378 file_go_chromium_org_luci_grpc_prpc_helloworld_test_proto_depIdxs = nil 379 } 380 381 // Reference imports to suppress errors if they are not otherwise used. 382 var _ context.Context 383 var _ grpc.ClientConnInterface 384 385 // This is a compile-time assertion to ensure that this generated file 386 // is compatible with the grpc package it is being compiled against. 387 const _ = grpc.SupportPackageIsVersion6 388 389 // GreeterClient is the client API for Greeter service. 390 // 391 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 392 type GreeterClient interface { 393 // Sends a greeting 394 SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) 395 } 396 type greeterPRPCClient struct { 397 client *Client 398 } 399 400 func NewGreeterPRPCClient(client *Client) GreeterClient { 401 return &greeterPRPCClient{client} 402 } 403 404 func (c *greeterPRPCClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { 405 out := new(HelloReply) 406 err := c.client.Call(ctx, "prpc.Greeter", "SayHello", in, out, opts...) 407 if err != nil { 408 return nil, err 409 } 410 return out, nil 411 } 412 413 type greeterClient struct { 414 cc grpc.ClientConnInterface 415 } 416 417 func NewGreeterClient(cc grpc.ClientConnInterface) GreeterClient { 418 return &greeterClient{cc} 419 } 420 421 func (c *greeterClient) SayHello(ctx context.Context, in *HelloRequest, opts ...grpc.CallOption) (*HelloReply, error) { 422 out := new(HelloReply) 423 err := c.cc.Invoke(ctx, "/prpc.Greeter/SayHello", in, out, opts...) 424 if err != nil { 425 return nil, err 426 } 427 return out, nil 428 } 429 430 // GreeterServer is the server API for Greeter service. 431 type GreeterServer interface { 432 // Sends a greeting 433 SayHello(context.Context, *HelloRequest) (*HelloReply, error) 434 } 435 436 // UnimplementedGreeterServer can be embedded to have forward compatible implementations. 437 type UnimplementedGreeterServer struct { 438 } 439 440 func (*UnimplementedGreeterServer) SayHello(context.Context, *HelloRequest) (*HelloReply, error) { 441 return nil, status.Errorf(codes.Unimplemented, "method SayHello not implemented") 442 } 443 444 func RegisterGreeterServer(s Registrar, srv GreeterServer) { 445 s.RegisterService(&_Greeter_serviceDesc, srv) 446 } 447 448 func _Greeter_SayHello_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 449 in := new(HelloRequest) 450 if err := dec(in); err != nil { 451 return nil, err 452 } 453 if interceptor == nil { 454 return srv.(GreeterServer).SayHello(ctx, in) 455 } 456 info := &grpc.UnaryServerInfo{ 457 Server: srv, 458 FullMethod: "/prpc.Greeter/SayHello", 459 } 460 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 461 return srv.(GreeterServer).SayHello(ctx, req.(*HelloRequest)) 462 } 463 return interceptor(ctx, in, info, handler) 464 } 465 466 var _Greeter_serviceDesc = grpc.ServiceDesc{ 467 ServiceName: "prpc.Greeter", 468 HandlerType: (*GreeterServer)(nil), 469 Methods: []grpc.MethodDesc{ 470 { 471 MethodName: "SayHello", 472 Handler: _Greeter_SayHello_Handler, 473 }, 474 }, 475 Streams: []grpc.StreamDesc{}, 476 Metadata: "go.chromium.org/luci/grpc/prpc/helloworld_test.proto", 477 } 478 479 // CalcClient is the client API for Calc service. 480 // 481 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 482 type CalcClient interface { 483 Multiply(ctx context.Context, in *MultiplyRequest, opts ...grpc.CallOption) (*MultiplyResponse, error) 484 } 485 type calcPRPCClient struct { 486 client *Client 487 } 488 489 func NewCalcPRPCClient(client *Client) CalcClient { 490 return &calcPRPCClient{client} 491 } 492 493 func (c *calcPRPCClient) Multiply(ctx context.Context, in *MultiplyRequest, opts ...grpc.CallOption) (*MultiplyResponse, error) { 494 out := new(MultiplyResponse) 495 err := c.client.Call(ctx, "prpc.Calc", "Multiply", in, out, opts...) 496 if err != nil { 497 return nil, err 498 } 499 return out, nil 500 } 501 502 type calcClient struct { 503 cc grpc.ClientConnInterface 504 } 505 506 func NewCalcClient(cc grpc.ClientConnInterface) CalcClient { 507 return &calcClient{cc} 508 } 509 510 func (c *calcClient) Multiply(ctx context.Context, in *MultiplyRequest, opts ...grpc.CallOption) (*MultiplyResponse, error) { 511 out := new(MultiplyResponse) 512 err := c.cc.Invoke(ctx, "/prpc.Calc/Multiply", in, out, opts...) 513 if err != nil { 514 return nil, err 515 } 516 return out, nil 517 } 518 519 // CalcServer is the server API for Calc service. 520 type CalcServer interface { 521 Multiply(context.Context, *MultiplyRequest) (*MultiplyResponse, error) 522 } 523 524 // UnimplementedCalcServer can be embedded to have forward compatible implementations. 525 type UnimplementedCalcServer struct { 526 } 527 528 func (*UnimplementedCalcServer) Multiply(context.Context, *MultiplyRequest) (*MultiplyResponse, error) { 529 return nil, status.Errorf(codes.Unimplemented, "method Multiply not implemented") 530 } 531 532 func RegisterCalcServer(s Registrar, srv CalcServer) { 533 s.RegisterService(&_Calc_serviceDesc, srv) 534 } 535 536 func _Calc_Multiply_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 537 in := new(MultiplyRequest) 538 if err := dec(in); err != nil { 539 return nil, err 540 } 541 if interceptor == nil { 542 return srv.(CalcServer).Multiply(ctx, in) 543 } 544 info := &grpc.UnaryServerInfo{ 545 Server: srv, 546 FullMethod: "/prpc.Calc/Multiply", 547 } 548 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 549 return srv.(CalcServer).Multiply(ctx, req.(*MultiplyRequest)) 550 } 551 return interceptor(ctx, in, info, handler) 552 } 553 554 var _Calc_serviceDesc = grpc.ServiceDesc{ 555 ServiceName: "prpc.Calc", 556 HandlerType: (*CalcServer)(nil), 557 Methods: []grpc.MethodDesc{ 558 { 559 MethodName: "Multiply", 560 Handler: _Calc_Multiply_Handler, 561 }, 562 }, 563 Streams: []grpc.StreamDesc{}, 564 Metadata: "go.chromium.org/luci/grpc/prpc/helloworld_test.proto", 565 }