go.uber.org/yarpc@v1.72.1/internal/prototest/examplepb/example.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: internal/prototest/examplepb/example.proto 3 4 // Copyright (c) 2022 Uber Technologies, Inc. 5 // 6 // Permission is hereby granted, free of charge, to any person obtaining a copy 7 // of this software and associated documentation files (the "Software"), to deal 8 // in the Software without restriction, including without limitation the rights 9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 // copies of the Software, and to permit persons to whom the Software is 11 // furnished to do so, subject to the following conditions: 12 // 13 // The above copyright notice and this permission notice shall be included in 14 // all copies or substantial portions of the Software. 15 // 16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 // THE SOFTWARE. 23 24 package examplepb 25 26 import ( 27 context "context" 28 fmt "fmt" 29 proto "github.com/gogo/protobuf/proto" 30 grpc "google.golang.org/grpc" 31 codes "google.golang.org/grpc/codes" 32 status "google.golang.org/grpc/status" 33 io "io" 34 math "math" 35 math_bits "math/bits" 36 reflect "reflect" 37 strings "strings" 38 ) 39 40 // Reference imports to suppress errors if they are not otherwise used. 41 var _ = proto.Marshal 42 var _ = fmt.Errorf 43 var _ = math.Inf 44 45 // This is a compile-time assertion to ensure that this generated file 46 // is compatible with the proto package it is being compiled against. 47 // A compilation error at this line likely means your copy of the 48 // proto package needs to be updated. 49 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 50 51 type GetValueRequest struct { 52 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 53 } 54 55 func (m *GetValueRequest) Reset() { *m = GetValueRequest{} } 56 func (*GetValueRequest) ProtoMessage() {} 57 func (*GetValueRequest) Descriptor() ([]byte, []int) { 58 return fileDescriptor_bab15b635bbc13f7, []int{0} 59 } 60 func (m *GetValueRequest) XXX_Unmarshal(b []byte) error { 61 return m.Unmarshal(b) 62 } 63 func (m *GetValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 64 if deterministic { 65 return xxx_messageInfo_GetValueRequest.Marshal(b, m, deterministic) 66 } else { 67 b = b[:cap(b)] 68 n, err := m.MarshalToSizedBuffer(b) 69 if err != nil { 70 return nil, err 71 } 72 return b[:n], nil 73 } 74 } 75 func (m *GetValueRequest) XXX_Merge(src proto.Message) { 76 xxx_messageInfo_GetValueRequest.Merge(m, src) 77 } 78 func (m *GetValueRequest) XXX_Size() int { 79 return m.Size() 80 } 81 func (m *GetValueRequest) XXX_DiscardUnknown() { 82 xxx_messageInfo_GetValueRequest.DiscardUnknown(m) 83 } 84 85 var xxx_messageInfo_GetValueRequest proto.InternalMessageInfo 86 87 func (m *GetValueRequest) GetKey() string { 88 if m != nil { 89 return m.Key 90 } 91 return "" 92 } 93 94 type GetValueResponse struct { 95 Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 96 } 97 98 func (m *GetValueResponse) Reset() { *m = GetValueResponse{} } 99 func (*GetValueResponse) ProtoMessage() {} 100 func (*GetValueResponse) Descriptor() ([]byte, []int) { 101 return fileDescriptor_bab15b635bbc13f7, []int{1} 102 } 103 func (m *GetValueResponse) XXX_Unmarshal(b []byte) error { 104 return m.Unmarshal(b) 105 } 106 func (m *GetValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 107 if deterministic { 108 return xxx_messageInfo_GetValueResponse.Marshal(b, m, deterministic) 109 } else { 110 b = b[:cap(b)] 111 n, err := m.MarshalToSizedBuffer(b) 112 if err != nil { 113 return nil, err 114 } 115 return b[:n], nil 116 } 117 } 118 func (m *GetValueResponse) XXX_Merge(src proto.Message) { 119 xxx_messageInfo_GetValueResponse.Merge(m, src) 120 } 121 func (m *GetValueResponse) XXX_Size() int { 122 return m.Size() 123 } 124 func (m *GetValueResponse) XXX_DiscardUnknown() { 125 xxx_messageInfo_GetValueResponse.DiscardUnknown(m) 126 } 127 128 var xxx_messageInfo_GetValueResponse proto.InternalMessageInfo 129 130 func (m *GetValueResponse) GetValue() string { 131 if m != nil { 132 return m.Value 133 } 134 return "" 135 } 136 137 type SetValueRequest struct { 138 Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` 139 Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` 140 } 141 142 func (m *SetValueRequest) Reset() { *m = SetValueRequest{} } 143 func (*SetValueRequest) ProtoMessage() {} 144 func (*SetValueRequest) Descriptor() ([]byte, []int) { 145 return fileDescriptor_bab15b635bbc13f7, []int{2} 146 } 147 func (m *SetValueRequest) XXX_Unmarshal(b []byte) error { 148 return m.Unmarshal(b) 149 } 150 func (m *SetValueRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 151 if deterministic { 152 return xxx_messageInfo_SetValueRequest.Marshal(b, m, deterministic) 153 } else { 154 b = b[:cap(b)] 155 n, err := m.MarshalToSizedBuffer(b) 156 if err != nil { 157 return nil, err 158 } 159 return b[:n], nil 160 } 161 } 162 func (m *SetValueRequest) XXX_Merge(src proto.Message) { 163 xxx_messageInfo_SetValueRequest.Merge(m, src) 164 } 165 func (m *SetValueRequest) XXX_Size() int { 166 return m.Size() 167 } 168 func (m *SetValueRequest) XXX_DiscardUnknown() { 169 xxx_messageInfo_SetValueRequest.DiscardUnknown(m) 170 } 171 172 var xxx_messageInfo_SetValueRequest proto.InternalMessageInfo 173 174 func (m *SetValueRequest) GetKey() string { 175 if m != nil { 176 return m.Key 177 } 178 return "" 179 } 180 181 func (m *SetValueRequest) GetValue() string { 182 if m != nil { 183 return m.Value 184 } 185 return "" 186 } 187 188 type SetValueResponse struct { 189 } 190 191 func (m *SetValueResponse) Reset() { *m = SetValueResponse{} } 192 func (*SetValueResponse) ProtoMessage() {} 193 func (*SetValueResponse) Descriptor() ([]byte, []int) { 194 return fileDescriptor_bab15b635bbc13f7, []int{3} 195 } 196 func (m *SetValueResponse) XXX_Unmarshal(b []byte) error { 197 return m.Unmarshal(b) 198 } 199 func (m *SetValueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 200 if deterministic { 201 return xxx_messageInfo_SetValueResponse.Marshal(b, m, deterministic) 202 } else { 203 b = b[:cap(b)] 204 n, err := m.MarshalToSizedBuffer(b) 205 if err != nil { 206 return nil, err 207 } 208 return b[:n], nil 209 } 210 } 211 func (m *SetValueResponse) XXX_Merge(src proto.Message) { 212 xxx_messageInfo_SetValueResponse.Merge(m, src) 213 } 214 func (m *SetValueResponse) XXX_Size() int { 215 return m.Size() 216 } 217 func (m *SetValueResponse) XXX_DiscardUnknown() { 218 xxx_messageInfo_SetValueResponse.DiscardUnknown(m) 219 } 220 221 var xxx_messageInfo_SetValueResponse proto.InternalMessageInfo 222 223 type EchoOutRequest struct { 224 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 225 } 226 227 func (m *EchoOutRequest) Reset() { *m = EchoOutRequest{} } 228 func (*EchoOutRequest) ProtoMessage() {} 229 func (*EchoOutRequest) Descriptor() ([]byte, []int) { 230 return fileDescriptor_bab15b635bbc13f7, []int{4} 231 } 232 func (m *EchoOutRequest) XXX_Unmarshal(b []byte) error { 233 return m.Unmarshal(b) 234 } 235 func (m *EchoOutRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 236 if deterministic { 237 return xxx_messageInfo_EchoOutRequest.Marshal(b, m, deterministic) 238 } else { 239 b = b[:cap(b)] 240 n, err := m.MarshalToSizedBuffer(b) 241 if err != nil { 242 return nil, err 243 } 244 return b[:n], nil 245 } 246 } 247 func (m *EchoOutRequest) XXX_Merge(src proto.Message) { 248 xxx_messageInfo_EchoOutRequest.Merge(m, src) 249 } 250 func (m *EchoOutRequest) XXX_Size() int { 251 return m.Size() 252 } 253 func (m *EchoOutRequest) XXX_DiscardUnknown() { 254 xxx_messageInfo_EchoOutRequest.DiscardUnknown(m) 255 } 256 257 var xxx_messageInfo_EchoOutRequest proto.InternalMessageInfo 258 259 func (m *EchoOutRequest) GetMessage() string { 260 if m != nil { 261 return m.Message 262 } 263 return "" 264 } 265 266 type EchoOutResponse struct { 267 AllMessages []string `protobuf:"bytes,2,rep,name=all_messages,json=allMessages,proto3" json:"all_messages,omitempty"` 268 } 269 270 func (m *EchoOutResponse) Reset() { *m = EchoOutResponse{} } 271 func (*EchoOutResponse) ProtoMessage() {} 272 func (*EchoOutResponse) Descriptor() ([]byte, []int) { 273 return fileDescriptor_bab15b635bbc13f7, []int{5} 274 } 275 func (m *EchoOutResponse) XXX_Unmarshal(b []byte) error { 276 return m.Unmarshal(b) 277 } 278 func (m *EchoOutResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 279 if deterministic { 280 return xxx_messageInfo_EchoOutResponse.Marshal(b, m, deterministic) 281 } else { 282 b = b[:cap(b)] 283 n, err := m.MarshalToSizedBuffer(b) 284 if err != nil { 285 return nil, err 286 } 287 return b[:n], nil 288 } 289 } 290 func (m *EchoOutResponse) XXX_Merge(src proto.Message) { 291 xxx_messageInfo_EchoOutResponse.Merge(m, src) 292 } 293 func (m *EchoOutResponse) XXX_Size() int { 294 return m.Size() 295 } 296 func (m *EchoOutResponse) XXX_DiscardUnknown() { 297 xxx_messageInfo_EchoOutResponse.DiscardUnknown(m) 298 } 299 300 var xxx_messageInfo_EchoOutResponse proto.InternalMessageInfo 301 302 func (m *EchoOutResponse) GetAllMessages() []string { 303 if m != nil { 304 return m.AllMessages 305 } 306 return nil 307 } 308 309 type EchoInRequest struct { 310 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 311 NumResponses int64 `protobuf:"varint,2,opt,name=num_responses,json=numResponses,proto3" json:"num_responses,omitempty"` 312 } 313 314 func (m *EchoInRequest) Reset() { *m = EchoInRequest{} } 315 func (*EchoInRequest) ProtoMessage() {} 316 func (*EchoInRequest) Descriptor() ([]byte, []int) { 317 return fileDescriptor_bab15b635bbc13f7, []int{6} 318 } 319 func (m *EchoInRequest) XXX_Unmarshal(b []byte) error { 320 return m.Unmarshal(b) 321 } 322 func (m *EchoInRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 323 if deterministic { 324 return xxx_messageInfo_EchoInRequest.Marshal(b, m, deterministic) 325 } else { 326 b = b[:cap(b)] 327 n, err := m.MarshalToSizedBuffer(b) 328 if err != nil { 329 return nil, err 330 } 331 return b[:n], nil 332 } 333 } 334 func (m *EchoInRequest) XXX_Merge(src proto.Message) { 335 xxx_messageInfo_EchoInRequest.Merge(m, src) 336 } 337 func (m *EchoInRequest) XXX_Size() int { 338 return m.Size() 339 } 340 func (m *EchoInRequest) XXX_DiscardUnknown() { 341 xxx_messageInfo_EchoInRequest.DiscardUnknown(m) 342 } 343 344 var xxx_messageInfo_EchoInRequest proto.InternalMessageInfo 345 346 func (m *EchoInRequest) GetMessage() string { 347 if m != nil { 348 return m.Message 349 } 350 return "" 351 } 352 353 func (m *EchoInRequest) GetNumResponses() int64 { 354 if m != nil { 355 return m.NumResponses 356 } 357 return 0 358 } 359 360 type EchoInResponse struct { 361 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 362 } 363 364 func (m *EchoInResponse) Reset() { *m = EchoInResponse{} } 365 func (*EchoInResponse) ProtoMessage() {} 366 func (*EchoInResponse) Descriptor() ([]byte, []int) { 367 return fileDescriptor_bab15b635bbc13f7, []int{7} 368 } 369 func (m *EchoInResponse) XXX_Unmarshal(b []byte) error { 370 return m.Unmarshal(b) 371 } 372 func (m *EchoInResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 373 if deterministic { 374 return xxx_messageInfo_EchoInResponse.Marshal(b, m, deterministic) 375 } else { 376 b = b[:cap(b)] 377 n, err := m.MarshalToSizedBuffer(b) 378 if err != nil { 379 return nil, err 380 } 381 return b[:n], nil 382 } 383 } 384 func (m *EchoInResponse) XXX_Merge(src proto.Message) { 385 xxx_messageInfo_EchoInResponse.Merge(m, src) 386 } 387 func (m *EchoInResponse) XXX_Size() int { 388 return m.Size() 389 } 390 func (m *EchoInResponse) XXX_DiscardUnknown() { 391 xxx_messageInfo_EchoInResponse.DiscardUnknown(m) 392 } 393 394 var xxx_messageInfo_EchoInResponse proto.InternalMessageInfo 395 396 func (m *EchoInResponse) GetMessage() string { 397 if m != nil { 398 return m.Message 399 } 400 return "" 401 } 402 403 type EchoBothRequest struct { 404 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 405 NumResponses int64 `protobuf:"varint,2,opt,name=num_responses,json=numResponses,proto3" json:"num_responses,omitempty"` 406 } 407 408 func (m *EchoBothRequest) Reset() { *m = EchoBothRequest{} } 409 func (*EchoBothRequest) ProtoMessage() {} 410 func (*EchoBothRequest) Descriptor() ([]byte, []int) { 411 return fileDescriptor_bab15b635bbc13f7, []int{8} 412 } 413 func (m *EchoBothRequest) XXX_Unmarshal(b []byte) error { 414 return m.Unmarshal(b) 415 } 416 func (m *EchoBothRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 417 if deterministic { 418 return xxx_messageInfo_EchoBothRequest.Marshal(b, m, deterministic) 419 } else { 420 b = b[:cap(b)] 421 n, err := m.MarshalToSizedBuffer(b) 422 if err != nil { 423 return nil, err 424 } 425 return b[:n], nil 426 } 427 } 428 func (m *EchoBothRequest) XXX_Merge(src proto.Message) { 429 xxx_messageInfo_EchoBothRequest.Merge(m, src) 430 } 431 func (m *EchoBothRequest) XXX_Size() int { 432 return m.Size() 433 } 434 func (m *EchoBothRequest) XXX_DiscardUnknown() { 435 xxx_messageInfo_EchoBothRequest.DiscardUnknown(m) 436 } 437 438 var xxx_messageInfo_EchoBothRequest proto.InternalMessageInfo 439 440 func (m *EchoBothRequest) GetMessage() string { 441 if m != nil { 442 return m.Message 443 } 444 return "" 445 } 446 447 func (m *EchoBothRequest) GetNumResponses() int64 { 448 if m != nil { 449 return m.NumResponses 450 } 451 return 0 452 } 453 454 type EchoBothResponse struct { 455 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 456 } 457 458 func (m *EchoBothResponse) Reset() { *m = EchoBothResponse{} } 459 func (*EchoBothResponse) ProtoMessage() {} 460 func (*EchoBothResponse) Descriptor() ([]byte, []int) { 461 return fileDescriptor_bab15b635bbc13f7, []int{9} 462 } 463 func (m *EchoBothResponse) XXX_Unmarshal(b []byte) error { 464 return m.Unmarshal(b) 465 } 466 func (m *EchoBothResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 467 if deterministic { 468 return xxx_messageInfo_EchoBothResponse.Marshal(b, m, deterministic) 469 } else { 470 b = b[:cap(b)] 471 n, err := m.MarshalToSizedBuffer(b) 472 if err != nil { 473 return nil, err 474 } 475 return b[:n], nil 476 } 477 } 478 func (m *EchoBothResponse) XXX_Merge(src proto.Message) { 479 xxx_messageInfo_EchoBothResponse.Merge(m, src) 480 } 481 func (m *EchoBothResponse) XXX_Size() int { 482 return m.Size() 483 } 484 func (m *EchoBothResponse) XXX_DiscardUnknown() { 485 xxx_messageInfo_EchoBothResponse.DiscardUnknown(m) 486 } 487 488 var xxx_messageInfo_EchoBothResponse proto.InternalMessageInfo 489 490 func (m *EchoBothResponse) GetMessage() string { 491 if m != nil { 492 return m.Message 493 } 494 return "" 495 } 496 497 // Get2ndMessageRequest and Get2ndMessageResponse are messages used 498 // to test that messages generated by the yarpc protoc plugin and by protoc-gen-gogo 499 // follows the same GoType conventions as gogo/protobuf. 500 type Get2NdMessageRequest struct { 501 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 502 } 503 504 func (m *Get2NdMessageRequest) Reset() { *m = Get2NdMessageRequest{} } 505 func (*Get2NdMessageRequest) ProtoMessage() {} 506 func (*Get2NdMessageRequest) Descriptor() ([]byte, []int) { 507 return fileDescriptor_bab15b635bbc13f7, []int{10} 508 } 509 func (m *Get2NdMessageRequest) XXX_Unmarshal(b []byte) error { 510 return m.Unmarshal(b) 511 } 512 func (m *Get2NdMessageRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 513 if deterministic { 514 return xxx_messageInfo_Get2NdMessageRequest.Marshal(b, m, deterministic) 515 } else { 516 b = b[:cap(b)] 517 n, err := m.MarshalToSizedBuffer(b) 518 if err != nil { 519 return nil, err 520 } 521 return b[:n], nil 522 } 523 } 524 func (m *Get2NdMessageRequest) XXX_Merge(src proto.Message) { 525 xxx_messageInfo_Get2NdMessageRequest.Merge(m, src) 526 } 527 func (m *Get2NdMessageRequest) XXX_Size() int { 528 return m.Size() 529 } 530 func (m *Get2NdMessageRequest) XXX_DiscardUnknown() { 531 xxx_messageInfo_Get2NdMessageRequest.DiscardUnknown(m) 532 } 533 534 var xxx_messageInfo_Get2NdMessageRequest proto.InternalMessageInfo 535 536 func (m *Get2NdMessageRequest) GetMessage() string { 537 if m != nil { 538 return m.Message 539 } 540 return "" 541 } 542 543 type Get2NdMessageResponse struct { 544 Message string `protobuf:"bytes,1,opt,name=message,proto3" json:"message,omitempty"` 545 } 546 547 func (m *Get2NdMessageResponse) Reset() { *m = Get2NdMessageResponse{} } 548 func (*Get2NdMessageResponse) ProtoMessage() {} 549 func (*Get2NdMessageResponse) Descriptor() ([]byte, []int) { 550 return fileDescriptor_bab15b635bbc13f7, []int{11} 551 } 552 func (m *Get2NdMessageResponse) XXX_Unmarshal(b []byte) error { 553 return m.Unmarshal(b) 554 } 555 func (m *Get2NdMessageResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 556 if deterministic { 557 return xxx_messageInfo_Get2NdMessageResponse.Marshal(b, m, deterministic) 558 } else { 559 b = b[:cap(b)] 560 n, err := m.MarshalToSizedBuffer(b) 561 if err != nil { 562 return nil, err 563 } 564 return b[:n], nil 565 } 566 } 567 func (m *Get2NdMessageResponse) XXX_Merge(src proto.Message) { 568 xxx_messageInfo_Get2NdMessageResponse.Merge(m, src) 569 } 570 func (m *Get2NdMessageResponse) XXX_Size() int { 571 return m.Size() 572 } 573 func (m *Get2NdMessageResponse) XXX_DiscardUnknown() { 574 xxx_messageInfo_Get2NdMessageResponse.DiscardUnknown(m) 575 } 576 577 var xxx_messageInfo_Get2NdMessageResponse proto.InternalMessageInfo 578 579 func (m *Get2NdMessageResponse) GetMessage() string { 580 if m != nil { 581 return m.Message 582 } 583 return "" 584 } 585 586 func init() { 587 proto.RegisterType((*GetValueRequest)(nil), "uber.yarpc.internal.examples.protobuf.example.GetValueRequest") 588 proto.RegisterType((*GetValueResponse)(nil), "uber.yarpc.internal.examples.protobuf.example.GetValueResponse") 589 proto.RegisterType((*SetValueRequest)(nil), "uber.yarpc.internal.examples.protobuf.example.SetValueRequest") 590 proto.RegisterType((*SetValueResponse)(nil), "uber.yarpc.internal.examples.protobuf.example.SetValueResponse") 591 proto.RegisterType((*EchoOutRequest)(nil), "uber.yarpc.internal.examples.protobuf.example.EchoOutRequest") 592 proto.RegisterType((*EchoOutResponse)(nil), "uber.yarpc.internal.examples.protobuf.example.EchoOutResponse") 593 proto.RegisterType((*EchoInRequest)(nil), "uber.yarpc.internal.examples.protobuf.example.EchoInRequest") 594 proto.RegisterType((*EchoInResponse)(nil), "uber.yarpc.internal.examples.protobuf.example.EchoInResponse") 595 proto.RegisterType((*EchoBothRequest)(nil), "uber.yarpc.internal.examples.protobuf.example.EchoBothRequest") 596 proto.RegisterType((*EchoBothResponse)(nil), "uber.yarpc.internal.examples.protobuf.example.EchoBothResponse") 597 proto.RegisterType((*Get2NdMessageRequest)(nil), "uber.yarpc.internal.examples.protobuf.example.Get2ndMessageRequest") 598 proto.RegisterType((*Get2NdMessageResponse)(nil), "uber.yarpc.internal.examples.protobuf.example.Get2ndMessageResponse") 599 } 600 601 func init() { 602 proto.RegisterFile("internal/prototest/examplepb/example.proto", fileDescriptor_bab15b635bbc13f7) 603 } 604 605 var fileDescriptor_bab15b635bbc13f7 = []byte{ 606 // 526 bytes of a gzipped FileDescriptorProto 607 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4f, 0x4f, 0x13, 0x41, 608 0x14, 0xdf, 0xd7, 0x8d, 0xd0, 0x3e, 0xc0, 0x36, 0x13, 0x48, 0x9a, 0x1e, 0x26, 0xb8, 0x5c, 0x1a, 609 0xa2, 0x4b, 0xad, 0x5e, 0x4c, 0x04, 0x12, 0xfc, 0x43, 0x8c, 0x11, 0x49, 0x6b, 0x3c, 0x78, 0x21, 610 0x53, 0x1c, 0x85, 0xb8, 0xff, 0xdc, 0x99, 0x35, 0xf6, 0xe6, 0xd5, 0x44, 0x13, 0xbd, 0xfa, 0x09, 611 0x8c, 0x67, 0x3e, 0x84, 0xc7, 0x1e, 0x39, 0xda, 0xed, 0xc5, 0x23, 0x1f, 0xc1, 0xec, 0x76, 0xa6, 612 0x60, 0x09, 0xd9, 0xec, 0xc2, 0x6d, 0xe6, 0xf5, 0xfd, 0xfe, 0xf4, 0xcd, 0xef, 0x65, 0x71, 0xf5, 613 0xd0, 0x93, 0x3c, 0xf4, 0x98, 0xb3, 0x16, 0x84, 0xbe, 0xf4, 0x25, 0x17, 0x72, 0x8d, 0x7f, 0x64, 614 0x6e, 0xe0, 0xf0, 0xa0, 0xa7, 0x4f, 0x76, 0xfa, 0x1b, 0xb9, 0x15, 0xf5, 0x78, 0x68, 0xf7, 0x59, 615 0x18, 0xec, 0xdb, 0x1a, 0x66, 0xab, 0x16, 0x31, 0xee, 0xe9, 0x45, 0x6f, 0x74, 0xc5, 0x5a, 0xc1, 616 0xea, 0x36, 0x97, 0x2f, 0x99, 0x13, 0xf1, 0x0e, 0x7f, 0x1f, 0x71, 0x21, 0x49, 0x0d, 0xcd, 0x77, 617 0xbc, 0x5f, 0x87, 0x65, 0x68, 0x56, 0x3a, 0xc9, 0xd1, 0x6a, 0x62, 0xed, 0xb4, 0x49, 0x04, 0xbe, 618 0x27, 0x38, 0x59, 0xc4, 0x6b, 0x1f, 0x92, 0x42, 0xbd, 0x94, 0xf6, 0x8d, 0x2f, 0xd6, 0x3d, 0xac, 619 0x76, 0xb3, 0xe8, 0x2e, 0x80, 0x12, 0xac, 0x75, 0xa7, 0x44, 0xac, 0x55, 0xbc, 0xfe, 0x68, 0xff, 620 0xc0, 0x7f, 0x1e, 0x49, 0xcd, 0x56, 0xc7, 0x59, 0x97, 0x0b, 0xc1, 0xde, 0x72, 0xc5, 0xa8, 0xaf, 621 0xd6, 0x5d, 0xac, 0x4e, 0x7a, 0x95, 0xc7, 0x1b, 0x38, 0xcf, 0x1c, 0x67, 0x4f, 0x75, 0x88, 0x7a, 622 0x69, 0xd9, 0x6c, 0x56, 0x3a, 0x73, 0xcc, 0x71, 0x9e, 0xa9, 0x92, 0xb5, 0x83, 0x0b, 0x09, 0xea, 623 0x89, 0x97, 0x29, 0x40, 0x56, 0x70, 0xc1, 0x8b, 0xdc, 0xbd, 0x50, 0xb1, 0x8b, 0xd4, 0xbe, 0xd9, 624 0x99, 0xf7, 0x22, 0x57, 0x2b, 0x0a, 0xed, 0x38, 0xe1, 0x53, 0x26, 0x2e, 0x76, 0xbc, 0x3b, 0x76, 625 0xbc, 0xe5, 0xcb, 0x83, 0x2b, 0x52, 0xbf, 0x89, 0xb5, 0x53, 0xc6, 0x4c, 0xfd, 0x16, 0x2e, 0x6e, 626 0x73, 0xd9, 0xf6, 0x5e, 0xab, 0x69, 0x64, 0xcf, 0xf8, 0x36, 0x2e, 0x4d, 0x21, 0xb2, 0x44, 0xda, 627 0xbf, 0x4a, 0x58, 0x7e, 0xca, 0xfb, 0xe9, 0xbb, 0x92, 0xaf, 0x80, 0x65, 0x9d, 0x24, 0xb2, 0x61, 628 0xe7, 0x8a, 0xaa, 0x3d, 0x95, 0xd3, 0xc6, 0x66, 0x61, 0xbc, 0x4a, 0x97, 0x91, 0xfa, 0xe9, 0x16, 629 0xf5, 0xd3, 0xbd, 0xa4, 0x9f, 0x73, 0x69, 0x37, 0xda, 0x47, 0x26, 0x9a, 0x8f, 0x7d, 0x9f, 0x7c, 630 0x01, 0x9c, 0x55, 0x61, 0x26, 0xeb, 0x39, 0x69, 0xff, 0x5f, 0x98, 0xc6, 0x46, 0x51, 0xb8, 0x36, 631 0xd5, 0x04, 0xf2, 0x19, 0x70, 0x66, 0x9c, 0x6a, 0x72, 0xbf, 0x00, 0xdd, 0x64, 0xb9, 0x1a, 0xeb, 632 0x05, 0xd1, 0xda, 0x4b, 0x0b, 0xc8, 0x77, 0xc0, 0xb2, 0xce, 0x38, 0x29, 0xf2, 0xe7, 0xce, 0xac, 633 0x5b, 0xee, 0x27, 0x9b, 0x5e, 0xae, 0x64, 0x3a, 0x2d, 0x68, 0x1f, 0x01, 0x2e, 0xbd, 0xe0, 0x42, 634 0xaa, 0xad, 0xd8, 0x61, 0x2e, 0xdf, 0x65, 0xe1, 0xa1, 0xec, 0x93, 0x1f, 0x80, 0x73, 0x67, 0xaa, 635 0xe4, 0x41, 0xfe, 0xcc, 0x9e, 0xdb, 0xcf, 0xc6, 0xc3, 0xcb, 0x91, 0x68, 0xeb, 0x5b, 0x9b, 0x83, 636 0x21, 0x35, 0x8e, 0x87, 0xd4, 0x38, 0x19, 0x52, 0xf8, 0x14, 0x53, 0xf8, 0x19, 0x53, 0xf8, 0x1d, 637 0x53, 0x18, 0xc4, 0x14, 0xfe, 0xc4, 0x14, 0xfe, 0xc6, 0xd4, 0x38, 0x89, 0x29, 0x7c, 0x1b, 0x51, 638 0x63, 0x30, 0xa2, 0xc6, 0xf1, 0x88, 0x1a, 0xaf, 0x2a, 0x93, 0x2f, 0x4f, 0x6f, 0x26, 0x95, 0xba, 639 0xf3, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x75, 0x60, 0x32, 0x5c, 0xa0, 0x06, 0x00, 0x00, 640 } 641 642 func (this *GetValueRequest) Equal(that interface{}) bool { 643 if that == nil { 644 return this == nil 645 } 646 647 that1, ok := that.(*GetValueRequest) 648 if !ok { 649 that2, ok := that.(GetValueRequest) 650 if ok { 651 that1 = &that2 652 } else { 653 return false 654 } 655 } 656 if that1 == nil { 657 return this == nil 658 } else if this == nil { 659 return false 660 } 661 if this.Key != that1.Key { 662 return false 663 } 664 return true 665 } 666 func (this *GetValueResponse) Equal(that interface{}) bool { 667 if that == nil { 668 return this == nil 669 } 670 671 that1, ok := that.(*GetValueResponse) 672 if !ok { 673 that2, ok := that.(GetValueResponse) 674 if ok { 675 that1 = &that2 676 } else { 677 return false 678 } 679 } 680 if that1 == nil { 681 return this == nil 682 } else if this == nil { 683 return false 684 } 685 if this.Value != that1.Value { 686 return false 687 } 688 return true 689 } 690 func (this *SetValueRequest) Equal(that interface{}) bool { 691 if that == nil { 692 return this == nil 693 } 694 695 that1, ok := that.(*SetValueRequest) 696 if !ok { 697 that2, ok := that.(SetValueRequest) 698 if ok { 699 that1 = &that2 700 } else { 701 return false 702 } 703 } 704 if that1 == nil { 705 return this == nil 706 } else if this == nil { 707 return false 708 } 709 if this.Key != that1.Key { 710 return false 711 } 712 if this.Value != that1.Value { 713 return false 714 } 715 return true 716 } 717 func (this *SetValueResponse) Equal(that interface{}) bool { 718 if that == nil { 719 return this == nil 720 } 721 722 that1, ok := that.(*SetValueResponse) 723 if !ok { 724 that2, ok := that.(SetValueResponse) 725 if ok { 726 that1 = &that2 727 } else { 728 return false 729 } 730 } 731 if that1 == nil { 732 return this == nil 733 } else if this == nil { 734 return false 735 } 736 return true 737 } 738 func (this *EchoOutRequest) Equal(that interface{}) bool { 739 if that == nil { 740 return this == nil 741 } 742 743 that1, ok := that.(*EchoOutRequest) 744 if !ok { 745 that2, ok := that.(EchoOutRequest) 746 if ok { 747 that1 = &that2 748 } else { 749 return false 750 } 751 } 752 if that1 == nil { 753 return this == nil 754 } else if this == nil { 755 return false 756 } 757 if this.Message != that1.Message { 758 return false 759 } 760 return true 761 } 762 func (this *EchoOutResponse) Equal(that interface{}) bool { 763 if that == nil { 764 return this == nil 765 } 766 767 that1, ok := that.(*EchoOutResponse) 768 if !ok { 769 that2, ok := that.(EchoOutResponse) 770 if ok { 771 that1 = &that2 772 } else { 773 return false 774 } 775 } 776 if that1 == nil { 777 return this == nil 778 } else if this == nil { 779 return false 780 } 781 if len(this.AllMessages) != len(that1.AllMessages) { 782 return false 783 } 784 for i := range this.AllMessages { 785 if this.AllMessages[i] != that1.AllMessages[i] { 786 return false 787 } 788 } 789 return true 790 } 791 func (this *EchoInRequest) Equal(that interface{}) bool { 792 if that == nil { 793 return this == nil 794 } 795 796 that1, ok := that.(*EchoInRequest) 797 if !ok { 798 that2, ok := that.(EchoInRequest) 799 if ok { 800 that1 = &that2 801 } else { 802 return false 803 } 804 } 805 if that1 == nil { 806 return this == nil 807 } else if this == nil { 808 return false 809 } 810 if this.Message != that1.Message { 811 return false 812 } 813 if this.NumResponses != that1.NumResponses { 814 return false 815 } 816 return true 817 } 818 func (this *EchoInResponse) Equal(that interface{}) bool { 819 if that == nil { 820 return this == nil 821 } 822 823 that1, ok := that.(*EchoInResponse) 824 if !ok { 825 that2, ok := that.(EchoInResponse) 826 if ok { 827 that1 = &that2 828 } else { 829 return false 830 } 831 } 832 if that1 == nil { 833 return this == nil 834 } else if this == nil { 835 return false 836 } 837 if this.Message != that1.Message { 838 return false 839 } 840 return true 841 } 842 func (this *EchoBothRequest) Equal(that interface{}) bool { 843 if that == nil { 844 return this == nil 845 } 846 847 that1, ok := that.(*EchoBothRequest) 848 if !ok { 849 that2, ok := that.(EchoBothRequest) 850 if ok { 851 that1 = &that2 852 } else { 853 return false 854 } 855 } 856 if that1 == nil { 857 return this == nil 858 } else if this == nil { 859 return false 860 } 861 if this.Message != that1.Message { 862 return false 863 } 864 if this.NumResponses != that1.NumResponses { 865 return false 866 } 867 return true 868 } 869 func (this *EchoBothResponse) Equal(that interface{}) bool { 870 if that == nil { 871 return this == nil 872 } 873 874 that1, ok := that.(*EchoBothResponse) 875 if !ok { 876 that2, ok := that.(EchoBothResponse) 877 if ok { 878 that1 = &that2 879 } else { 880 return false 881 } 882 } 883 if that1 == nil { 884 return this == nil 885 } else if this == nil { 886 return false 887 } 888 if this.Message != that1.Message { 889 return false 890 } 891 return true 892 } 893 func (this *Get2NdMessageRequest) Equal(that interface{}) bool { 894 if that == nil { 895 return this == nil 896 } 897 898 that1, ok := that.(*Get2NdMessageRequest) 899 if !ok { 900 that2, ok := that.(Get2NdMessageRequest) 901 if ok { 902 that1 = &that2 903 } else { 904 return false 905 } 906 } 907 if that1 == nil { 908 return this == nil 909 } else if this == nil { 910 return false 911 } 912 if this.Message != that1.Message { 913 return false 914 } 915 return true 916 } 917 func (this *Get2NdMessageResponse) Equal(that interface{}) bool { 918 if that == nil { 919 return this == nil 920 } 921 922 that1, ok := that.(*Get2NdMessageResponse) 923 if !ok { 924 that2, ok := that.(Get2NdMessageResponse) 925 if ok { 926 that1 = &that2 927 } else { 928 return false 929 } 930 } 931 if that1 == nil { 932 return this == nil 933 } else if this == nil { 934 return false 935 } 936 if this.Message != that1.Message { 937 return false 938 } 939 return true 940 } 941 func (this *GetValueRequest) GoString() string { 942 if this == nil { 943 return "nil" 944 } 945 s := make([]string, 0, 5) 946 s = append(s, "&examplepb.GetValueRequest{") 947 s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") 948 s = append(s, "}") 949 return strings.Join(s, "") 950 } 951 func (this *GetValueResponse) GoString() string { 952 if this == nil { 953 return "nil" 954 } 955 s := make([]string, 0, 5) 956 s = append(s, "&examplepb.GetValueResponse{") 957 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 958 s = append(s, "}") 959 return strings.Join(s, "") 960 } 961 func (this *SetValueRequest) GoString() string { 962 if this == nil { 963 return "nil" 964 } 965 s := make([]string, 0, 6) 966 s = append(s, "&examplepb.SetValueRequest{") 967 s = append(s, "Key: "+fmt.Sprintf("%#v", this.Key)+",\n") 968 s = append(s, "Value: "+fmt.Sprintf("%#v", this.Value)+",\n") 969 s = append(s, "}") 970 return strings.Join(s, "") 971 } 972 func (this *SetValueResponse) GoString() string { 973 if this == nil { 974 return "nil" 975 } 976 s := make([]string, 0, 4) 977 s = append(s, "&examplepb.SetValueResponse{") 978 s = append(s, "}") 979 return strings.Join(s, "") 980 } 981 func (this *EchoOutRequest) GoString() string { 982 if this == nil { 983 return "nil" 984 } 985 s := make([]string, 0, 5) 986 s = append(s, "&examplepb.EchoOutRequest{") 987 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 988 s = append(s, "}") 989 return strings.Join(s, "") 990 } 991 func (this *EchoOutResponse) GoString() string { 992 if this == nil { 993 return "nil" 994 } 995 s := make([]string, 0, 5) 996 s = append(s, "&examplepb.EchoOutResponse{") 997 s = append(s, "AllMessages: "+fmt.Sprintf("%#v", this.AllMessages)+",\n") 998 s = append(s, "}") 999 return strings.Join(s, "") 1000 } 1001 func (this *EchoInRequest) GoString() string { 1002 if this == nil { 1003 return "nil" 1004 } 1005 s := make([]string, 0, 6) 1006 s = append(s, "&examplepb.EchoInRequest{") 1007 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 1008 s = append(s, "NumResponses: "+fmt.Sprintf("%#v", this.NumResponses)+",\n") 1009 s = append(s, "}") 1010 return strings.Join(s, "") 1011 } 1012 func (this *EchoInResponse) GoString() string { 1013 if this == nil { 1014 return "nil" 1015 } 1016 s := make([]string, 0, 5) 1017 s = append(s, "&examplepb.EchoInResponse{") 1018 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 1019 s = append(s, "}") 1020 return strings.Join(s, "") 1021 } 1022 func (this *EchoBothRequest) GoString() string { 1023 if this == nil { 1024 return "nil" 1025 } 1026 s := make([]string, 0, 6) 1027 s = append(s, "&examplepb.EchoBothRequest{") 1028 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 1029 s = append(s, "NumResponses: "+fmt.Sprintf("%#v", this.NumResponses)+",\n") 1030 s = append(s, "}") 1031 return strings.Join(s, "") 1032 } 1033 func (this *EchoBothResponse) GoString() string { 1034 if this == nil { 1035 return "nil" 1036 } 1037 s := make([]string, 0, 5) 1038 s = append(s, "&examplepb.EchoBothResponse{") 1039 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 1040 s = append(s, "}") 1041 return strings.Join(s, "") 1042 } 1043 func (this *Get2NdMessageRequest) GoString() string { 1044 if this == nil { 1045 return "nil" 1046 } 1047 s := make([]string, 0, 5) 1048 s = append(s, "&examplepb.Get2NdMessageRequest{") 1049 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 1050 s = append(s, "}") 1051 return strings.Join(s, "") 1052 } 1053 func (this *Get2NdMessageResponse) GoString() string { 1054 if this == nil { 1055 return "nil" 1056 } 1057 s := make([]string, 0, 5) 1058 s = append(s, "&examplepb.Get2NdMessageResponse{") 1059 s = append(s, "Message: "+fmt.Sprintf("%#v", this.Message)+",\n") 1060 s = append(s, "}") 1061 return strings.Join(s, "") 1062 } 1063 func valueToGoStringExample(v interface{}, typ string) string { 1064 rv := reflect.ValueOf(v) 1065 if rv.IsNil() { 1066 return "nil" 1067 } 1068 pv := reflect.Indirect(rv).Interface() 1069 return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) 1070 } 1071 1072 // Reference imports to suppress errors if they are not otherwise used. 1073 var _ context.Context 1074 var _ grpc.ClientConn 1075 1076 // This is a compile-time assertion to ensure that this generated file 1077 // is compatible with the grpc package it is being compiled against. 1078 const _ = grpc.SupportPackageIsVersion4 1079 1080 // KeyValueClient is the client API for KeyValue service. 1081 // 1082 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 1083 type KeyValueClient interface { 1084 GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error) 1085 SetValue(ctx context.Context, in *SetValueRequest, opts ...grpc.CallOption) (*SetValueResponse, error) 1086 } 1087 1088 type keyValueClient struct { 1089 cc *grpc.ClientConn 1090 } 1091 1092 func NewKeyValueClient(cc *grpc.ClientConn) KeyValueClient { 1093 return &keyValueClient{cc} 1094 } 1095 1096 func (c *keyValueClient) GetValue(ctx context.Context, in *GetValueRequest, opts ...grpc.CallOption) (*GetValueResponse, error) { 1097 out := new(GetValueResponse) 1098 err := c.cc.Invoke(ctx, "/uber.yarpc.internal.examples.protobuf.example.KeyValue/GetValue", in, out, opts...) 1099 if err != nil { 1100 return nil, err 1101 } 1102 return out, nil 1103 } 1104 1105 func (c *keyValueClient) SetValue(ctx context.Context, in *SetValueRequest, opts ...grpc.CallOption) (*SetValueResponse, error) { 1106 out := new(SetValueResponse) 1107 err := c.cc.Invoke(ctx, "/uber.yarpc.internal.examples.protobuf.example.KeyValue/SetValue", in, out, opts...) 1108 if err != nil { 1109 return nil, err 1110 } 1111 return out, nil 1112 } 1113 1114 // KeyValueServer is the server API for KeyValue service. 1115 type KeyValueServer interface { 1116 GetValue(context.Context, *GetValueRequest) (*GetValueResponse, error) 1117 SetValue(context.Context, *SetValueRequest) (*SetValueResponse, error) 1118 } 1119 1120 // UnimplementedKeyValueServer can be embedded to have forward compatible implementations. 1121 type UnimplementedKeyValueServer struct { 1122 } 1123 1124 func (*UnimplementedKeyValueServer) GetValue(ctx context.Context, req *GetValueRequest) (*GetValueResponse, error) { 1125 return nil, status.Errorf(codes.Unimplemented, "method GetValue not implemented") 1126 } 1127 func (*UnimplementedKeyValueServer) SetValue(ctx context.Context, req *SetValueRequest) (*SetValueResponse, error) { 1128 return nil, status.Errorf(codes.Unimplemented, "method SetValue not implemented") 1129 } 1130 1131 func RegisterKeyValueServer(s *grpc.Server, srv KeyValueServer) { 1132 s.RegisterService(&_KeyValue_serviceDesc, srv) 1133 } 1134 1135 func _KeyValue_GetValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1136 in := new(GetValueRequest) 1137 if err := dec(in); err != nil { 1138 return nil, err 1139 } 1140 if interceptor == nil { 1141 return srv.(KeyValueServer).GetValue(ctx, in) 1142 } 1143 info := &grpc.UnaryServerInfo{ 1144 Server: srv, 1145 FullMethod: "/uber.yarpc.internal.examples.protobuf.example.KeyValue/GetValue", 1146 } 1147 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1148 return srv.(KeyValueServer).GetValue(ctx, req.(*GetValueRequest)) 1149 } 1150 return interceptor(ctx, in, info, handler) 1151 } 1152 1153 func _KeyValue_SetValue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1154 in := new(SetValueRequest) 1155 if err := dec(in); err != nil { 1156 return nil, err 1157 } 1158 if interceptor == nil { 1159 return srv.(KeyValueServer).SetValue(ctx, in) 1160 } 1161 info := &grpc.UnaryServerInfo{ 1162 Server: srv, 1163 FullMethod: "/uber.yarpc.internal.examples.protobuf.example.KeyValue/SetValue", 1164 } 1165 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1166 return srv.(KeyValueServer).SetValue(ctx, req.(*SetValueRequest)) 1167 } 1168 return interceptor(ctx, in, info, handler) 1169 } 1170 1171 var _KeyValue_serviceDesc = grpc.ServiceDesc{ 1172 ServiceName: "uber.yarpc.internal.examples.protobuf.example.KeyValue", 1173 HandlerType: (*KeyValueServer)(nil), 1174 Methods: []grpc.MethodDesc{ 1175 { 1176 MethodName: "GetValue", 1177 Handler: _KeyValue_GetValue_Handler, 1178 }, 1179 { 1180 MethodName: "SetValue", 1181 Handler: _KeyValue_SetValue_Handler, 1182 }, 1183 }, 1184 Streams: []grpc.StreamDesc{}, 1185 Metadata: "internal/prototest/examplepb/example.proto", 1186 } 1187 1188 // FooClient is the client API for Foo service. 1189 // 1190 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 1191 type FooClient interface { 1192 EchoOut(ctx context.Context, opts ...grpc.CallOption) (Foo_EchoOutClient, error) 1193 EchoIn(ctx context.Context, in *EchoInRequest, opts ...grpc.CallOption) (Foo_EchoInClient, error) 1194 EchoBoth(ctx context.Context, opts ...grpc.CallOption) (Foo_EchoBothClient, error) 1195 } 1196 1197 type fooClient struct { 1198 cc *grpc.ClientConn 1199 } 1200 1201 func NewFooClient(cc *grpc.ClientConn) FooClient { 1202 return &fooClient{cc} 1203 } 1204 1205 func (c *fooClient) EchoOut(ctx context.Context, opts ...grpc.CallOption) (Foo_EchoOutClient, error) { 1206 stream, err := c.cc.NewStream(ctx, &_Foo_serviceDesc.Streams[0], "/uber.yarpc.internal.examples.protobuf.example.Foo/EchoOut", opts...) 1207 if err != nil { 1208 return nil, err 1209 } 1210 x := &fooEchoOutClient{stream} 1211 return x, nil 1212 } 1213 1214 type Foo_EchoOutClient interface { 1215 Send(*EchoOutRequest) error 1216 CloseAndRecv() (*EchoOutResponse, error) 1217 grpc.ClientStream 1218 } 1219 1220 type fooEchoOutClient struct { 1221 grpc.ClientStream 1222 } 1223 1224 func (x *fooEchoOutClient) Send(m *EchoOutRequest) error { 1225 return x.ClientStream.SendMsg(m) 1226 } 1227 1228 func (x *fooEchoOutClient) CloseAndRecv() (*EchoOutResponse, error) { 1229 if err := x.ClientStream.CloseSend(); err != nil { 1230 return nil, err 1231 } 1232 m := new(EchoOutResponse) 1233 if err := x.ClientStream.RecvMsg(m); err != nil { 1234 return nil, err 1235 } 1236 return m, nil 1237 } 1238 1239 func (c *fooClient) EchoIn(ctx context.Context, in *EchoInRequest, opts ...grpc.CallOption) (Foo_EchoInClient, error) { 1240 stream, err := c.cc.NewStream(ctx, &_Foo_serviceDesc.Streams[1], "/uber.yarpc.internal.examples.protobuf.example.Foo/EchoIn", opts...) 1241 if err != nil { 1242 return nil, err 1243 } 1244 x := &fooEchoInClient{stream} 1245 if err := x.ClientStream.SendMsg(in); err != nil { 1246 return nil, err 1247 } 1248 if err := x.ClientStream.CloseSend(); err != nil { 1249 return nil, err 1250 } 1251 return x, nil 1252 } 1253 1254 type Foo_EchoInClient interface { 1255 Recv() (*EchoInResponse, error) 1256 grpc.ClientStream 1257 } 1258 1259 type fooEchoInClient struct { 1260 grpc.ClientStream 1261 } 1262 1263 func (x *fooEchoInClient) Recv() (*EchoInResponse, error) { 1264 m := new(EchoInResponse) 1265 if err := x.ClientStream.RecvMsg(m); err != nil { 1266 return nil, err 1267 } 1268 return m, nil 1269 } 1270 1271 func (c *fooClient) EchoBoth(ctx context.Context, opts ...grpc.CallOption) (Foo_EchoBothClient, error) { 1272 stream, err := c.cc.NewStream(ctx, &_Foo_serviceDesc.Streams[2], "/uber.yarpc.internal.examples.protobuf.example.Foo/EchoBoth", opts...) 1273 if err != nil { 1274 return nil, err 1275 } 1276 x := &fooEchoBothClient{stream} 1277 return x, nil 1278 } 1279 1280 type Foo_EchoBothClient interface { 1281 Send(*EchoBothRequest) error 1282 Recv() (*EchoBothResponse, error) 1283 grpc.ClientStream 1284 } 1285 1286 type fooEchoBothClient struct { 1287 grpc.ClientStream 1288 } 1289 1290 func (x *fooEchoBothClient) Send(m *EchoBothRequest) error { 1291 return x.ClientStream.SendMsg(m) 1292 } 1293 1294 func (x *fooEchoBothClient) Recv() (*EchoBothResponse, error) { 1295 m := new(EchoBothResponse) 1296 if err := x.ClientStream.RecvMsg(m); err != nil { 1297 return nil, err 1298 } 1299 return m, nil 1300 } 1301 1302 // FooServer is the server API for Foo service. 1303 type FooServer interface { 1304 EchoOut(Foo_EchoOutServer) error 1305 EchoIn(*EchoInRequest, Foo_EchoInServer) error 1306 EchoBoth(Foo_EchoBothServer) error 1307 } 1308 1309 // UnimplementedFooServer can be embedded to have forward compatible implementations. 1310 type UnimplementedFooServer struct { 1311 } 1312 1313 func (*UnimplementedFooServer) EchoOut(srv Foo_EchoOutServer) error { 1314 return status.Errorf(codes.Unimplemented, "method EchoOut not implemented") 1315 } 1316 func (*UnimplementedFooServer) EchoIn(req *EchoInRequest, srv Foo_EchoInServer) error { 1317 return status.Errorf(codes.Unimplemented, "method EchoIn not implemented") 1318 } 1319 func (*UnimplementedFooServer) EchoBoth(srv Foo_EchoBothServer) error { 1320 return status.Errorf(codes.Unimplemented, "method EchoBoth not implemented") 1321 } 1322 1323 func RegisterFooServer(s *grpc.Server, srv FooServer) { 1324 s.RegisterService(&_Foo_serviceDesc, srv) 1325 } 1326 1327 func _Foo_EchoOut_Handler(srv interface{}, stream grpc.ServerStream) error { 1328 return srv.(FooServer).EchoOut(&fooEchoOutServer{stream}) 1329 } 1330 1331 type Foo_EchoOutServer interface { 1332 SendAndClose(*EchoOutResponse) error 1333 Recv() (*EchoOutRequest, error) 1334 grpc.ServerStream 1335 } 1336 1337 type fooEchoOutServer struct { 1338 grpc.ServerStream 1339 } 1340 1341 func (x *fooEchoOutServer) SendAndClose(m *EchoOutResponse) error { 1342 return x.ServerStream.SendMsg(m) 1343 } 1344 1345 func (x *fooEchoOutServer) Recv() (*EchoOutRequest, error) { 1346 m := new(EchoOutRequest) 1347 if err := x.ServerStream.RecvMsg(m); err != nil { 1348 return nil, err 1349 } 1350 return m, nil 1351 } 1352 1353 func _Foo_EchoIn_Handler(srv interface{}, stream grpc.ServerStream) error { 1354 m := new(EchoInRequest) 1355 if err := stream.RecvMsg(m); err != nil { 1356 return err 1357 } 1358 return srv.(FooServer).EchoIn(m, &fooEchoInServer{stream}) 1359 } 1360 1361 type Foo_EchoInServer interface { 1362 Send(*EchoInResponse) error 1363 grpc.ServerStream 1364 } 1365 1366 type fooEchoInServer struct { 1367 grpc.ServerStream 1368 } 1369 1370 func (x *fooEchoInServer) Send(m *EchoInResponse) error { 1371 return x.ServerStream.SendMsg(m) 1372 } 1373 1374 func _Foo_EchoBoth_Handler(srv interface{}, stream grpc.ServerStream) error { 1375 return srv.(FooServer).EchoBoth(&fooEchoBothServer{stream}) 1376 } 1377 1378 type Foo_EchoBothServer interface { 1379 Send(*EchoBothResponse) error 1380 Recv() (*EchoBothRequest, error) 1381 grpc.ServerStream 1382 } 1383 1384 type fooEchoBothServer struct { 1385 grpc.ServerStream 1386 } 1387 1388 func (x *fooEchoBothServer) Send(m *EchoBothResponse) error { 1389 return x.ServerStream.SendMsg(m) 1390 } 1391 1392 func (x *fooEchoBothServer) Recv() (*EchoBothRequest, error) { 1393 m := new(EchoBothRequest) 1394 if err := x.ServerStream.RecvMsg(m); err != nil { 1395 return nil, err 1396 } 1397 return m, nil 1398 } 1399 1400 var _Foo_serviceDesc = grpc.ServiceDesc{ 1401 ServiceName: "uber.yarpc.internal.examples.protobuf.example.Foo", 1402 HandlerType: (*FooServer)(nil), 1403 Methods: []grpc.MethodDesc{}, 1404 Streams: []grpc.StreamDesc{ 1405 { 1406 StreamName: "EchoOut", 1407 Handler: _Foo_EchoOut_Handler, 1408 ClientStreams: true, 1409 }, 1410 { 1411 StreamName: "EchoIn", 1412 Handler: _Foo_EchoIn_Handler, 1413 ServerStreams: true, 1414 }, 1415 { 1416 StreamName: "EchoBoth", 1417 Handler: _Foo_EchoBoth_Handler, 1418 ServerStreams: true, 1419 ClientStreams: true, 1420 }, 1421 }, 1422 Metadata: "internal/prototest/examplepb/example.proto", 1423 } 1424 1425 // TestMessageNameParityClient is the client API for TestMessageNameParity service. 1426 // 1427 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 1428 type TestMessageNameParityClient interface { 1429 MessageName(ctx context.Context, in *Get2NdMessageRequest, opts ...grpc.CallOption) (*Get2NdMessageResponse, error) 1430 } 1431 1432 type testMessageNameParityClient struct { 1433 cc *grpc.ClientConn 1434 } 1435 1436 func NewTestMessageNameParityClient(cc *grpc.ClientConn) TestMessageNameParityClient { 1437 return &testMessageNameParityClient{cc} 1438 } 1439 1440 func (c *testMessageNameParityClient) MessageName(ctx context.Context, in *Get2NdMessageRequest, opts ...grpc.CallOption) (*Get2NdMessageResponse, error) { 1441 out := new(Get2NdMessageResponse) 1442 err := c.cc.Invoke(ctx, "/uber.yarpc.internal.examples.protobuf.example.TestMessageNameParity/MessageName", in, out, opts...) 1443 if err != nil { 1444 return nil, err 1445 } 1446 return out, nil 1447 } 1448 1449 // TestMessageNameParityServer is the server API for TestMessageNameParity service. 1450 type TestMessageNameParityServer interface { 1451 MessageName(context.Context, *Get2NdMessageRequest) (*Get2NdMessageResponse, error) 1452 } 1453 1454 // UnimplementedTestMessageNameParityServer can be embedded to have forward compatible implementations. 1455 type UnimplementedTestMessageNameParityServer struct { 1456 } 1457 1458 func (*UnimplementedTestMessageNameParityServer) MessageName(ctx context.Context, req *Get2NdMessageRequest) (*Get2NdMessageResponse, error) { 1459 return nil, status.Errorf(codes.Unimplemented, "method MessageName not implemented") 1460 } 1461 1462 func RegisterTestMessageNameParityServer(s *grpc.Server, srv TestMessageNameParityServer) { 1463 s.RegisterService(&_TestMessageNameParity_serviceDesc, srv) 1464 } 1465 1466 func _TestMessageNameParity_MessageName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 1467 in := new(Get2NdMessageRequest) 1468 if err := dec(in); err != nil { 1469 return nil, err 1470 } 1471 if interceptor == nil { 1472 return srv.(TestMessageNameParityServer).MessageName(ctx, in) 1473 } 1474 info := &grpc.UnaryServerInfo{ 1475 Server: srv, 1476 FullMethod: "/uber.yarpc.internal.examples.protobuf.example.TestMessageNameParity/MessageName", 1477 } 1478 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 1479 return srv.(TestMessageNameParityServer).MessageName(ctx, req.(*Get2NdMessageRequest)) 1480 } 1481 return interceptor(ctx, in, info, handler) 1482 } 1483 1484 var _TestMessageNameParity_serviceDesc = grpc.ServiceDesc{ 1485 ServiceName: "uber.yarpc.internal.examples.protobuf.example.TestMessageNameParity", 1486 HandlerType: (*TestMessageNameParityServer)(nil), 1487 Methods: []grpc.MethodDesc{ 1488 { 1489 MethodName: "MessageName", 1490 Handler: _TestMessageNameParity_MessageName_Handler, 1491 }, 1492 }, 1493 Streams: []grpc.StreamDesc{}, 1494 Metadata: "internal/prototest/examplepb/example.proto", 1495 } 1496 1497 func (m *GetValueRequest) Marshal() (dAtA []byte, err error) { 1498 size := m.Size() 1499 dAtA = make([]byte, size) 1500 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1501 if err != nil { 1502 return nil, err 1503 } 1504 return dAtA[:n], nil 1505 } 1506 1507 func (m *GetValueRequest) MarshalTo(dAtA []byte) (int, error) { 1508 size := m.Size() 1509 return m.MarshalToSizedBuffer(dAtA[:size]) 1510 } 1511 1512 func (m *GetValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1513 i := len(dAtA) 1514 _ = i 1515 var l int 1516 _ = l 1517 if len(m.Key) > 0 { 1518 i -= len(m.Key) 1519 copy(dAtA[i:], m.Key) 1520 i = encodeVarintExample(dAtA, i, uint64(len(m.Key))) 1521 i-- 1522 dAtA[i] = 0xa 1523 } 1524 return len(dAtA) - i, nil 1525 } 1526 1527 func (m *GetValueResponse) Marshal() (dAtA []byte, err error) { 1528 size := m.Size() 1529 dAtA = make([]byte, size) 1530 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1531 if err != nil { 1532 return nil, err 1533 } 1534 return dAtA[:n], nil 1535 } 1536 1537 func (m *GetValueResponse) MarshalTo(dAtA []byte) (int, error) { 1538 size := m.Size() 1539 return m.MarshalToSizedBuffer(dAtA[:size]) 1540 } 1541 1542 func (m *GetValueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1543 i := len(dAtA) 1544 _ = i 1545 var l int 1546 _ = l 1547 if len(m.Value) > 0 { 1548 i -= len(m.Value) 1549 copy(dAtA[i:], m.Value) 1550 i = encodeVarintExample(dAtA, i, uint64(len(m.Value))) 1551 i-- 1552 dAtA[i] = 0x12 1553 } 1554 return len(dAtA) - i, nil 1555 } 1556 1557 func (m *SetValueRequest) Marshal() (dAtA []byte, err error) { 1558 size := m.Size() 1559 dAtA = make([]byte, size) 1560 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1561 if err != nil { 1562 return nil, err 1563 } 1564 return dAtA[:n], nil 1565 } 1566 1567 func (m *SetValueRequest) MarshalTo(dAtA []byte) (int, error) { 1568 size := m.Size() 1569 return m.MarshalToSizedBuffer(dAtA[:size]) 1570 } 1571 1572 func (m *SetValueRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1573 i := len(dAtA) 1574 _ = i 1575 var l int 1576 _ = l 1577 if len(m.Value) > 0 { 1578 i -= len(m.Value) 1579 copy(dAtA[i:], m.Value) 1580 i = encodeVarintExample(dAtA, i, uint64(len(m.Value))) 1581 i-- 1582 dAtA[i] = 0x12 1583 } 1584 if len(m.Key) > 0 { 1585 i -= len(m.Key) 1586 copy(dAtA[i:], m.Key) 1587 i = encodeVarintExample(dAtA, i, uint64(len(m.Key))) 1588 i-- 1589 dAtA[i] = 0xa 1590 } 1591 return len(dAtA) - i, nil 1592 } 1593 1594 func (m *SetValueResponse) Marshal() (dAtA []byte, err error) { 1595 size := m.Size() 1596 dAtA = make([]byte, size) 1597 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1598 if err != nil { 1599 return nil, err 1600 } 1601 return dAtA[:n], nil 1602 } 1603 1604 func (m *SetValueResponse) MarshalTo(dAtA []byte) (int, error) { 1605 size := m.Size() 1606 return m.MarshalToSizedBuffer(dAtA[:size]) 1607 } 1608 1609 func (m *SetValueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1610 i := len(dAtA) 1611 _ = i 1612 var l int 1613 _ = l 1614 return len(dAtA) - i, nil 1615 } 1616 1617 func (m *EchoOutRequest) Marshal() (dAtA []byte, err error) { 1618 size := m.Size() 1619 dAtA = make([]byte, size) 1620 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1621 if err != nil { 1622 return nil, err 1623 } 1624 return dAtA[:n], nil 1625 } 1626 1627 func (m *EchoOutRequest) MarshalTo(dAtA []byte) (int, error) { 1628 size := m.Size() 1629 return m.MarshalToSizedBuffer(dAtA[:size]) 1630 } 1631 1632 func (m *EchoOutRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1633 i := len(dAtA) 1634 _ = i 1635 var l int 1636 _ = l 1637 if len(m.Message) > 0 { 1638 i -= len(m.Message) 1639 copy(dAtA[i:], m.Message) 1640 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1641 i-- 1642 dAtA[i] = 0xa 1643 } 1644 return len(dAtA) - i, nil 1645 } 1646 1647 func (m *EchoOutResponse) Marshal() (dAtA []byte, err error) { 1648 size := m.Size() 1649 dAtA = make([]byte, size) 1650 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1651 if err != nil { 1652 return nil, err 1653 } 1654 return dAtA[:n], nil 1655 } 1656 1657 func (m *EchoOutResponse) MarshalTo(dAtA []byte) (int, error) { 1658 size := m.Size() 1659 return m.MarshalToSizedBuffer(dAtA[:size]) 1660 } 1661 1662 func (m *EchoOutResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1663 i := len(dAtA) 1664 _ = i 1665 var l int 1666 _ = l 1667 if len(m.AllMessages) > 0 { 1668 for iNdEx := len(m.AllMessages) - 1; iNdEx >= 0; iNdEx-- { 1669 i -= len(m.AllMessages[iNdEx]) 1670 copy(dAtA[i:], m.AllMessages[iNdEx]) 1671 i = encodeVarintExample(dAtA, i, uint64(len(m.AllMessages[iNdEx]))) 1672 i-- 1673 dAtA[i] = 0x12 1674 } 1675 } 1676 return len(dAtA) - i, nil 1677 } 1678 1679 func (m *EchoInRequest) Marshal() (dAtA []byte, err error) { 1680 size := m.Size() 1681 dAtA = make([]byte, size) 1682 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1683 if err != nil { 1684 return nil, err 1685 } 1686 return dAtA[:n], nil 1687 } 1688 1689 func (m *EchoInRequest) MarshalTo(dAtA []byte) (int, error) { 1690 size := m.Size() 1691 return m.MarshalToSizedBuffer(dAtA[:size]) 1692 } 1693 1694 func (m *EchoInRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1695 i := len(dAtA) 1696 _ = i 1697 var l int 1698 _ = l 1699 if m.NumResponses != 0 { 1700 i = encodeVarintExample(dAtA, i, uint64(m.NumResponses)) 1701 i-- 1702 dAtA[i] = 0x10 1703 } 1704 if len(m.Message) > 0 { 1705 i -= len(m.Message) 1706 copy(dAtA[i:], m.Message) 1707 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1708 i-- 1709 dAtA[i] = 0xa 1710 } 1711 return len(dAtA) - i, nil 1712 } 1713 1714 func (m *EchoInResponse) Marshal() (dAtA []byte, err error) { 1715 size := m.Size() 1716 dAtA = make([]byte, size) 1717 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1718 if err != nil { 1719 return nil, err 1720 } 1721 return dAtA[:n], nil 1722 } 1723 1724 func (m *EchoInResponse) MarshalTo(dAtA []byte) (int, error) { 1725 size := m.Size() 1726 return m.MarshalToSizedBuffer(dAtA[:size]) 1727 } 1728 1729 func (m *EchoInResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1730 i := len(dAtA) 1731 _ = i 1732 var l int 1733 _ = l 1734 if len(m.Message) > 0 { 1735 i -= len(m.Message) 1736 copy(dAtA[i:], m.Message) 1737 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1738 i-- 1739 dAtA[i] = 0xa 1740 } 1741 return len(dAtA) - i, nil 1742 } 1743 1744 func (m *EchoBothRequest) Marshal() (dAtA []byte, err error) { 1745 size := m.Size() 1746 dAtA = make([]byte, size) 1747 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1748 if err != nil { 1749 return nil, err 1750 } 1751 return dAtA[:n], nil 1752 } 1753 1754 func (m *EchoBothRequest) MarshalTo(dAtA []byte) (int, error) { 1755 size := m.Size() 1756 return m.MarshalToSizedBuffer(dAtA[:size]) 1757 } 1758 1759 func (m *EchoBothRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1760 i := len(dAtA) 1761 _ = i 1762 var l int 1763 _ = l 1764 if m.NumResponses != 0 { 1765 i = encodeVarintExample(dAtA, i, uint64(m.NumResponses)) 1766 i-- 1767 dAtA[i] = 0x10 1768 } 1769 if len(m.Message) > 0 { 1770 i -= len(m.Message) 1771 copy(dAtA[i:], m.Message) 1772 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1773 i-- 1774 dAtA[i] = 0xa 1775 } 1776 return len(dAtA) - i, nil 1777 } 1778 1779 func (m *EchoBothResponse) Marshal() (dAtA []byte, err error) { 1780 size := m.Size() 1781 dAtA = make([]byte, size) 1782 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1783 if err != nil { 1784 return nil, err 1785 } 1786 return dAtA[:n], nil 1787 } 1788 1789 func (m *EchoBothResponse) MarshalTo(dAtA []byte) (int, error) { 1790 size := m.Size() 1791 return m.MarshalToSizedBuffer(dAtA[:size]) 1792 } 1793 1794 func (m *EchoBothResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1795 i := len(dAtA) 1796 _ = i 1797 var l int 1798 _ = l 1799 if len(m.Message) > 0 { 1800 i -= len(m.Message) 1801 copy(dAtA[i:], m.Message) 1802 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1803 i-- 1804 dAtA[i] = 0xa 1805 } 1806 return len(dAtA) - i, nil 1807 } 1808 1809 func (m *Get2NdMessageRequest) Marshal() (dAtA []byte, err error) { 1810 size := m.Size() 1811 dAtA = make([]byte, size) 1812 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1813 if err != nil { 1814 return nil, err 1815 } 1816 return dAtA[:n], nil 1817 } 1818 1819 func (m *Get2NdMessageRequest) MarshalTo(dAtA []byte) (int, error) { 1820 size := m.Size() 1821 return m.MarshalToSizedBuffer(dAtA[:size]) 1822 } 1823 1824 func (m *Get2NdMessageRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1825 i := len(dAtA) 1826 _ = i 1827 var l int 1828 _ = l 1829 if len(m.Message) > 0 { 1830 i -= len(m.Message) 1831 copy(dAtA[i:], m.Message) 1832 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1833 i-- 1834 dAtA[i] = 0xa 1835 } 1836 return len(dAtA) - i, nil 1837 } 1838 1839 func (m *Get2NdMessageResponse) Marshal() (dAtA []byte, err error) { 1840 size := m.Size() 1841 dAtA = make([]byte, size) 1842 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 1843 if err != nil { 1844 return nil, err 1845 } 1846 return dAtA[:n], nil 1847 } 1848 1849 func (m *Get2NdMessageResponse) MarshalTo(dAtA []byte) (int, error) { 1850 size := m.Size() 1851 return m.MarshalToSizedBuffer(dAtA[:size]) 1852 } 1853 1854 func (m *Get2NdMessageResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 1855 i := len(dAtA) 1856 _ = i 1857 var l int 1858 _ = l 1859 if len(m.Message) > 0 { 1860 i -= len(m.Message) 1861 copy(dAtA[i:], m.Message) 1862 i = encodeVarintExample(dAtA, i, uint64(len(m.Message))) 1863 i-- 1864 dAtA[i] = 0xa 1865 } 1866 return len(dAtA) - i, nil 1867 } 1868 1869 func encodeVarintExample(dAtA []byte, offset int, v uint64) int { 1870 offset -= sovExample(v) 1871 base := offset 1872 for v >= 1<<7 { 1873 dAtA[offset] = uint8(v&0x7f | 0x80) 1874 v >>= 7 1875 offset++ 1876 } 1877 dAtA[offset] = uint8(v) 1878 return base 1879 } 1880 func (m *GetValueRequest) Size() (n int) { 1881 if m == nil { 1882 return 0 1883 } 1884 var l int 1885 _ = l 1886 l = len(m.Key) 1887 if l > 0 { 1888 n += 1 + l + sovExample(uint64(l)) 1889 } 1890 return n 1891 } 1892 1893 func (m *GetValueResponse) Size() (n int) { 1894 if m == nil { 1895 return 0 1896 } 1897 var l int 1898 _ = l 1899 l = len(m.Value) 1900 if l > 0 { 1901 n += 1 + l + sovExample(uint64(l)) 1902 } 1903 return n 1904 } 1905 1906 func (m *SetValueRequest) Size() (n int) { 1907 if m == nil { 1908 return 0 1909 } 1910 var l int 1911 _ = l 1912 l = len(m.Key) 1913 if l > 0 { 1914 n += 1 + l + sovExample(uint64(l)) 1915 } 1916 l = len(m.Value) 1917 if l > 0 { 1918 n += 1 + l + sovExample(uint64(l)) 1919 } 1920 return n 1921 } 1922 1923 func (m *SetValueResponse) Size() (n int) { 1924 if m == nil { 1925 return 0 1926 } 1927 var l int 1928 _ = l 1929 return n 1930 } 1931 1932 func (m *EchoOutRequest) Size() (n int) { 1933 if m == nil { 1934 return 0 1935 } 1936 var l int 1937 _ = l 1938 l = len(m.Message) 1939 if l > 0 { 1940 n += 1 + l + sovExample(uint64(l)) 1941 } 1942 return n 1943 } 1944 1945 func (m *EchoOutResponse) Size() (n int) { 1946 if m == nil { 1947 return 0 1948 } 1949 var l int 1950 _ = l 1951 if len(m.AllMessages) > 0 { 1952 for _, s := range m.AllMessages { 1953 l = len(s) 1954 n += 1 + l + sovExample(uint64(l)) 1955 } 1956 } 1957 return n 1958 } 1959 1960 func (m *EchoInRequest) Size() (n int) { 1961 if m == nil { 1962 return 0 1963 } 1964 var l int 1965 _ = l 1966 l = len(m.Message) 1967 if l > 0 { 1968 n += 1 + l + sovExample(uint64(l)) 1969 } 1970 if m.NumResponses != 0 { 1971 n += 1 + sovExample(uint64(m.NumResponses)) 1972 } 1973 return n 1974 } 1975 1976 func (m *EchoInResponse) Size() (n int) { 1977 if m == nil { 1978 return 0 1979 } 1980 var l int 1981 _ = l 1982 l = len(m.Message) 1983 if l > 0 { 1984 n += 1 + l + sovExample(uint64(l)) 1985 } 1986 return n 1987 } 1988 1989 func (m *EchoBothRequest) Size() (n int) { 1990 if m == nil { 1991 return 0 1992 } 1993 var l int 1994 _ = l 1995 l = len(m.Message) 1996 if l > 0 { 1997 n += 1 + l + sovExample(uint64(l)) 1998 } 1999 if m.NumResponses != 0 { 2000 n += 1 + sovExample(uint64(m.NumResponses)) 2001 } 2002 return n 2003 } 2004 2005 func (m *EchoBothResponse) Size() (n int) { 2006 if m == nil { 2007 return 0 2008 } 2009 var l int 2010 _ = l 2011 l = len(m.Message) 2012 if l > 0 { 2013 n += 1 + l + sovExample(uint64(l)) 2014 } 2015 return n 2016 } 2017 2018 func (m *Get2NdMessageRequest) Size() (n int) { 2019 if m == nil { 2020 return 0 2021 } 2022 var l int 2023 _ = l 2024 l = len(m.Message) 2025 if l > 0 { 2026 n += 1 + l + sovExample(uint64(l)) 2027 } 2028 return n 2029 } 2030 2031 func (m *Get2NdMessageResponse) Size() (n int) { 2032 if m == nil { 2033 return 0 2034 } 2035 var l int 2036 _ = l 2037 l = len(m.Message) 2038 if l > 0 { 2039 n += 1 + l + sovExample(uint64(l)) 2040 } 2041 return n 2042 } 2043 2044 func sovExample(x uint64) (n int) { 2045 return (math_bits.Len64(x|1) + 6) / 7 2046 } 2047 func sozExample(x uint64) (n int) { 2048 return sovExample(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 2049 } 2050 func (this *GetValueRequest) String() string { 2051 if this == nil { 2052 return "nil" 2053 } 2054 s := strings.Join([]string{`&GetValueRequest{`, 2055 `Key:` + fmt.Sprintf("%v", this.Key) + `,`, 2056 `}`, 2057 }, "") 2058 return s 2059 } 2060 func (this *GetValueResponse) String() string { 2061 if this == nil { 2062 return "nil" 2063 } 2064 s := strings.Join([]string{`&GetValueResponse{`, 2065 `Value:` + fmt.Sprintf("%v", this.Value) + `,`, 2066 `}`, 2067 }, "") 2068 return s 2069 } 2070 func (this *SetValueRequest) String() string { 2071 if this == nil { 2072 return "nil" 2073 } 2074 s := strings.Join([]string{`&SetValueRequest{`, 2075 `Key:` + fmt.Sprintf("%v", this.Key) + `,`, 2076 `Value:` + fmt.Sprintf("%v", this.Value) + `,`, 2077 `}`, 2078 }, "") 2079 return s 2080 } 2081 func (this *SetValueResponse) String() string { 2082 if this == nil { 2083 return "nil" 2084 } 2085 s := strings.Join([]string{`&SetValueResponse{`, 2086 `}`, 2087 }, "") 2088 return s 2089 } 2090 func (this *EchoOutRequest) String() string { 2091 if this == nil { 2092 return "nil" 2093 } 2094 s := strings.Join([]string{`&EchoOutRequest{`, 2095 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2096 `}`, 2097 }, "") 2098 return s 2099 } 2100 func (this *EchoOutResponse) String() string { 2101 if this == nil { 2102 return "nil" 2103 } 2104 s := strings.Join([]string{`&EchoOutResponse{`, 2105 `AllMessages:` + fmt.Sprintf("%v", this.AllMessages) + `,`, 2106 `}`, 2107 }, "") 2108 return s 2109 } 2110 func (this *EchoInRequest) String() string { 2111 if this == nil { 2112 return "nil" 2113 } 2114 s := strings.Join([]string{`&EchoInRequest{`, 2115 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2116 `NumResponses:` + fmt.Sprintf("%v", this.NumResponses) + `,`, 2117 `}`, 2118 }, "") 2119 return s 2120 } 2121 func (this *EchoInResponse) String() string { 2122 if this == nil { 2123 return "nil" 2124 } 2125 s := strings.Join([]string{`&EchoInResponse{`, 2126 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2127 `}`, 2128 }, "") 2129 return s 2130 } 2131 func (this *EchoBothRequest) String() string { 2132 if this == nil { 2133 return "nil" 2134 } 2135 s := strings.Join([]string{`&EchoBothRequest{`, 2136 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2137 `NumResponses:` + fmt.Sprintf("%v", this.NumResponses) + `,`, 2138 `}`, 2139 }, "") 2140 return s 2141 } 2142 func (this *EchoBothResponse) String() string { 2143 if this == nil { 2144 return "nil" 2145 } 2146 s := strings.Join([]string{`&EchoBothResponse{`, 2147 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2148 `}`, 2149 }, "") 2150 return s 2151 } 2152 func (this *Get2NdMessageRequest) String() string { 2153 if this == nil { 2154 return "nil" 2155 } 2156 s := strings.Join([]string{`&Get2NdMessageRequest{`, 2157 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2158 `}`, 2159 }, "") 2160 return s 2161 } 2162 func (this *Get2NdMessageResponse) String() string { 2163 if this == nil { 2164 return "nil" 2165 } 2166 s := strings.Join([]string{`&Get2NdMessageResponse{`, 2167 `Message:` + fmt.Sprintf("%v", this.Message) + `,`, 2168 `}`, 2169 }, "") 2170 return s 2171 } 2172 func valueToStringExample(v interface{}) string { 2173 rv := reflect.ValueOf(v) 2174 if rv.IsNil() { 2175 return "nil" 2176 } 2177 pv := reflect.Indirect(rv).Interface() 2178 return fmt.Sprintf("*%v", pv) 2179 } 2180 func (m *GetValueRequest) Unmarshal(dAtA []byte) error { 2181 l := len(dAtA) 2182 iNdEx := 0 2183 for iNdEx < l { 2184 preIndex := iNdEx 2185 var wire uint64 2186 for shift := uint(0); ; shift += 7 { 2187 if shift >= 64 { 2188 return ErrIntOverflowExample 2189 } 2190 if iNdEx >= l { 2191 return io.ErrUnexpectedEOF 2192 } 2193 b := dAtA[iNdEx] 2194 iNdEx++ 2195 wire |= uint64(b&0x7F) << shift 2196 if b < 0x80 { 2197 break 2198 } 2199 } 2200 fieldNum := int32(wire >> 3) 2201 wireType := int(wire & 0x7) 2202 if wireType == 4 { 2203 return fmt.Errorf("proto: GetValueRequest: wiretype end group for non-group") 2204 } 2205 if fieldNum <= 0 { 2206 return fmt.Errorf("proto: GetValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) 2207 } 2208 switch fieldNum { 2209 case 1: 2210 if wireType != 2 { 2211 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 2212 } 2213 var stringLen uint64 2214 for shift := uint(0); ; shift += 7 { 2215 if shift >= 64 { 2216 return ErrIntOverflowExample 2217 } 2218 if iNdEx >= l { 2219 return io.ErrUnexpectedEOF 2220 } 2221 b := dAtA[iNdEx] 2222 iNdEx++ 2223 stringLen |= uint64(b&0x7F) << shift 2224 if b < 0x80 { 2225 break 2226 } 2227 } 2228 intStringLen := int(stringLen) 2229 if intStringLen < 0 { 2230 return ErrInvalidLengthExample 2231 } 2232 postIndex := iNdEx + intStringLen 2233 if postIndex < 0 { 2234 return ErrInvalidLengthExample 2235 } 2236 if postIndex > l { 2237 return io.ErrUnexpectedEOF 2238 } 2239 m.Key = string(dAtA[iNdEx:postIndex]) 2240 iNdEx = postIndex 2241 default: 2242 iNdEx = preIndex 2243 skippy, err := skipExample(dAtA[iNdEx:]) 2244 if err != nil { 2245 return err 2246 } 2247 if skippy < 0 { 2248 return ErrInvalidLengthExample 2249 } 2250 if (iNdEx + skippy) < 0 { 2251 return ErrInvalidLengthExample 2252 } 2253 if (iNdEx + skippy) > l { 2254 return io.ErrUnexpectedEOF 2255 } 2256 iNdEx += skippy 2257 } 2258 } 2259 2260 if iNdEx > l { 2261 return io.ErrUnexpectedEOF 2262 } 2263 return nil 2264 } 2265 func (m *GetValueResponse) Unmarshal(dAtA []byte) error { 2266 l := len(dAtA) 2267 iNdEx := 0 2268 for iNdEx < l { 2269 preIndex := iNdEx 2270 var wire uint64 2271 for shift := uint(0); ; shift += 7 { 2272 if shift >= 64 { 2273 return ErrIntOverflowExample 2274 } 2275 if iNdEx >= l { 2276 return io.ErrUnexpectedEOF 2277 } 2278 b := dAtA[iNdEx] 2279 iNdEx++ 2280 wire |= uint64(b&0x7F) << shift 2281 if b < 0x80 { 2282 break 2283 } 2284 } 2285 fieldNum := int32(wire >> 3) 2286 wireType := int(wire & 0x7) 2287 if wireType == 4 { 2288 return fmt.Errorf("proto: GetValueResponse: wiretype end group for non-group") 2289 } 2290 if fieldNum <= 0 { 2291 return fmt.Errorf("proto: GetValueResponse: illegal tag %d (wire type %d)", fieldNum, wire) 2292 } 2293 switch fieldNum { 2294 case 2: 2295 if wireType != 2 { 2296 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 2297 } 2298 var stringLen uint64 2299 for shift := uint(0); ; shift += 7 { 2300 if shift >= 64 { 2301 return ErrIntOverflowExample 2302 } 2303 if iNdEx >= l { 2304 return io.ErrUnexpectedEOF 2305 } 2306 b := dAtA[iNdEx] 2307 iNdEx++ 2308 stringLen |= uint64(b&0x7F) << shift 2309 if b < 0x80 { 2310 break 2311 } 2312 } 2313 intStringLen := int(stringLen) 2314 if intStringLen < 0 { 2315 return ErrInvalidLengthExample 2316 } 2317 postIndex := iNdEx + intStringLen 2318 if postIndex < 0 { 2319 return ErrInvalidLengthExample 2320 } 2321 if postIndex > l { 2322 return io.ErrUnexpectedEOF 2323 } 2324 m.Value = string(dAtA[iNdEx:postIndex]) 2325 iNdEx = postIndex 2326 default: 2327 iNdEx = preIndex 2328 skippy, err := skipExample(dAtA[iNdEx:]) 2329 if err != nil { 2330 return err 2331 } 2332 if skippy < 0 { 2333 return ErrInvalidLengthExample 2334 } 2335 if (iNdEx + skippy) < 0 { 2336 return ErrInvalidLengthExample 2337 } 2338 if (iNdEx + skippy) > l { 2339 return io.ErrUnexpectedEOF 2340 } 2341 iNdEx += skippy 2342 } 2343 } 2344 2345 if iNdEx > l { 2346 return io.ErrUnexpectedEOF 2347 } 2348 return nil 2349 } 2350 func (m *SetValueRequest) Unmarshal(dAtA []byte) error { 2351 l := len(dAtA) 2352 iNdEx := 0 2353 for iNdEx < l { 2354 preIndex := iNdEx 2355 var wire uint64 2356 for shift := uint(0); ; shift += 7 { 2357 if shift >= 64 { 2358 return ErrIntOverflowExample 2359 } 2360 if iNdEx >= l { 2361 return io.ErrUnexpectedEOF 2362 } 2363 b := dAtA[iNdEx] 2364 iNdEx++ 2365 wire |= uint64(b&0x7F) << shift 2366 if b < 0x80 { 2367 break 2368 } 2369 } 2370 fieldNum := int32(wire >> 3) 2371 wireType := int(wire & 0x7) 2372 if wireType == 4 { 2373 return fmt.Errorf("proto: SetValueRequest: wiretype end group for non-group") 2374 } 2375 if fieldNum <= 0 { 2376 return fmt.Errorf("proto: SetValueRequest: illegal tag %d (wire type %d)", fieldNum, wire) 2377 } 2378 switch fieldNum { 2379 case 1: 2380 if wireType != 2 { 2381 return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) 2382 } 2383 var stringLen uint64 2384 for shift := uint(0); ; shift += 7 { 2385 if shift >= 64 { 2386 return ErrIntOverflowExample 2387 } 2388 if iNdEx >= l { 2389 return io.ErrUnexpectedEOF 2390 } 2391 b := dAtA[iNdEx] 2392 iNdEx++ 2393 stringLen |= uint64(b&0x7F) << shift 2394 if b < 0x80 { 2395 break 2396 } 2397 } 2398 intStringLen := int(stringLen) 2399 if intStringLen < 0 { 2400 return ErrInvalidLengthExample 2401 } 2402 postIndex := iNdEx + intStringLen 2403 if postIndex < 0 { 2404 return ErrInvalidLengthExample 2405 } 2406 if postIndex > l { 2407 return io.ErrUnexpectedEOF 2408 } 2409 m.Key = string(dAtA[iNdEx:postIndex]) 2410 iNdEx = postIndex 2411 case 2: 2412 if wireType != 2 { 2413 return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) 2414 } 2415 var stringLen uint64 2416 for shift := uint(0); ; shift += 7 { 2417 if shift >= 64 { 2418 return ErrIntOverflowExample 2419 } 2420 if iNdEx >= l { 2421 return io.ErrUnexpectedEOF 2422 } 2423 b := dAtA[iNdEx] 2424 iNdEx++ 2425 stringLen |= uint64(b&0x7F) << shift 2426 if b < 0x80 { 2427 break 2428 } 2429 } 2430 intStringLen := int(stringLen) 2431 if intStringLen < 0 { 2432 return ErrInvalidLengthExample 2433 } 2434 postIndex := iNdEx + intStringLen 2435 if postIndex < 0 { 2436 return ErrInvalidLengthExample 2437 } 2438 if postIndex > l { 2439 return io.ErrUnexpectedEOF 2440 } 2441 m.Value = string(dAtA[iNdEx:postIndex]) 2442 iNdEx = postIndex 2443 default: 2444 iNdEx = preIndex 2445 skippy, err := skipExample(dAtA[iNdEx:]) 2446 if err != nil { 2447 return err 2448 } 2449 if skippy < 0 { 2450 return ErrInvalidLengthExample 2451 } 2452 if (iNdEx + skippy) < 0 { 2453 return ErrInvalidLengthExample 2454 } 2455 if (iNdEx + skippy) > l { 2456 return io.ErrUnexpectedEOF 2457 } 2458 iNdEx += skippy 2459 } 2460 } 2461 2462 if iNdEx > l { 2463 return io.ErrUnexpectedEOF 2464 } 2465 return nil 2466 } 2467 func (m *SetValueResponse) Unmarshal(dAtA []byte) error { 2468 l := len(dAtA) 2469 iNdEx := 0 2470 for iNdEx < l { 2471 preIndex := iNdEx 2472 var wire uint64 2473 for shift := uint(0); ; shift += 7 { 2474 if shift >= 64 { 2475 return ErrIntOverflowExample 2476 } 2477 if iNdEx >= l { 2478 return io.ErrUnexpectedEOF 2479 } 2480 b := dAtA[iNdEx] 2481 iNdEx++ 2482 wire |= uint64(b&0x7F) << shift 2483 if b < 0x80 { 2484 break 2485 } 2486 } 2487 fieldNum := int32(wire >> 3) 2488 wireType := int(wire & 0x7) 2489 if wireType == 4 { 2490 return fmt.Errorf("proto: SetValueResponse: wiretype end group for non-group") 2491 } 2492 if fieldNum <= 0 { 2493 return fmt.Errorf("proto: SetValueResponse: illegal tag %d (wire type %d)", fieldNum, wire) 2494 } 2495 switch fieldNum { 2496 default: 2497 iNdEx = preIndex 2498 skippy, err := skipExample(dAtA[iNdEx:]) 2499 if err != nil { 2500 return err 2501 } 2502 if skippy < 0 { 2503 return ErrInvalidLengthExample 2504 } 2505 if (iNdEx + skippy) < 0 { 2506 return ErrInvalidLengthExample 2507 } 2508 if (iNdEx + skippy) > l { 2509 return io.ErrUnexpectedEOF 2510 } 2511 iNdEx += skippy 2512 } 2513 } 2514 2515 if iNdEx > l { 2516 return io.ErrUnexpectedEOF 2517 } 2518 return nil 2519 } 2520 func (m *EchoOutRequest) Unmarshal(dAtA []byte) error { 2521 l := len(dAtA) 2522 iNdEx := 0 2523 for iNdEx < l { 2524 preIndex := iNdEx 2525 var wire uint64 2526 for shift := uint(0); ; shift += 7 { 2527 if shift >= 64 { 2528 return ErrIntOverflowExample 2529 } 2530 if iNdEx >= l { 2531 return io.ErrUnexpectedEOF 2532 } 2533 b := dAtA[iNdEx] 2534 iNdEx++ 2535 wire |= uint64(b&0x7F) << shift 2536 if b < 0x80 { 2537 break 2538 } 2539 } 2540 fieldNum := int32(wire >> 3) 2541 wireType := int(wire & 0x7) 2542 if wireType == 4 { 2543 return fmt.Errorf("proto: EchoOutRequest: wiretype end group for non-group") 2544 } 2545 if fieldNum <= 0 { 2546 return fmt.Errorf("proto: EchoOutRequest: illegal tag %d (wire type %d)", fieldNum, wire) 2547 } 2548 switch fieldNum { 2549 case 1: 2550 if wireType != 2 { 2551 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 2552 } 2553 var stringLen uint64 2554 for shift := uint(0); ; shift += 7 { 2555 if shift >= 64 { 2556 return ErrIntOverflowExample 2557 } 2558 if iNdEx >= l { 2559 return io.ErrUnexpectedEOF 2560 } 2561 b := dAtA[iNdEx] 2562 iNdEx++ 2563 stringLen |= uint64(b&0x7F) << shift 2564 if b < 0x80 { 2565 break 2566 } 2567 } 2568 intStringLen := int(stringLen) 2569 if intStringLen < 0 { 2570 return ErrInvalidLengthExample 2571 } 2572 postIndex := iNdEx + intStringLen 2573 if postIndex < 0 { 2574 return ErrInvalidLengthExample 2575 } 2576 if postIndex > l { 2577 return io.ErrUnexpectedEOF 2578 } 2579 m.Message = string(dAtA[iNdEx:postIndex]) 2580 iNdEx = postIndex 2581 default: 2582 iNdEx = preIndex 2583 skippy, err := skipExample(dAtA[iNdEx:]) 2584 if err != nil { 2585 return err 2586 } 2587 if skippy < 0 { 2588 return ErrInvalidLengthExample 2589 } 2590 if (iNdEx + skippy) < 0 { 2591 return ErrInvalidLengthExample 2592 } 2593 if (iNdEx + skippy) > l { 2594 return io.ErrUnexpectedEOF 2595 } 2596 iNdEx += skippy 2597 } 2598 } 2599 2600 if iNdEx > l { 2601 return io.ErrUnexpectedEOF 2602 } 2603 return nil 2604 } 2605 func (m *EchoOutResponse) Unmarshal(dAtA []byte) error { 2606 l := len(dAtA) 2607 iNdEx := 0 2608 for iNdEx < l { 2609 preIndex := iNdEx 2610 var wire uint64 2611 for shift := uint(0); ; shift += 7 { 2612 if shift >= 64 { 2613 return ErrIntOverflowExample 2614 } 2615 if iNdEx >= l { 2616 return io.ErrUnexpectedEOF 2617 } 2618 b := dAtA[iNdEx] 2619 iNdEx++ 2620 wire |= uint64(b&0x7F) << shift 2621 if b < 0x80 { 2622 break 2623 } 2624 } 2625 fieldNum := int32(wire >> 3) 2626 wireType := int(wire & 0x7) 2627 if wireType == 4 { 2628 return fmt.Errorf("proto: EchoOutResponse: wiretype end group for non-group") 2629 } 2630 if fieldNum <= 0 { 2631 return fmt.Errorf("proto: EchoOutResponse: illegal tag %d (wire type %d)", fieldNum, wire) 2632 } 2633 switch fieldNum { 2634 case 2: 2635 if wireType != 2 { 2636 return fmt.Errorf("proto: wrong wireType = %d for field AllMessages", wireType) 2637 } 2638 var stringLen uint64 2639 for shift := uint(0); ; shift += 7 { 2640 if shift >= 64 { 2641 return ErrIntOverflowExample 2642 } 2643 if iNdEx >= l { 2644 return io.ErrUnexpectedEOF 2645 } 2646 b := dAtA[iNdEx] 2647 iNdEx++ 2648 stringLen |= uint64(b&0x7F) << shift 2649 if b < 0x80 { 2650 break 2651 } 2652 } 2653 intStringLen := int(stringLen) 2654 if intStringLen < 0 { 2655 return ErrInvalidLengthExample 2656 } 2657 postIndex := iNdEx + intStringLen 2658 if postIndex < 0 { 2659 return ErrInvalidLengthExample 2660 } 2661 if postIndex > l { 2662 return io.ErrUnexpectedEOF 2663 } 2664 m.AllMessages = append(m.AllMessages, string(dAtA[iNdEx:postIndex])) 2665 iNdEx = postIndex 2666 default: 2667 iNdEx = preIndex 2668 skippy, err := skipExample(dAtA[iNdEx:]) 2669 if err != nil { 2670 return err 2671 } 2672 if skippy < 0 { 2673 return ErrInvalidLengthExample 2674 } 2675 if (iNdEx + skippy) < 0 { 2676 return ErrInvalidLengthExample 2677 } 2678 if (iNdEx + skippy) > l { 2679 return io.ErrUnexpectedEOF 2680 } 2681 iNdEx += skippy 2682 } 2683 } 2684 2685 if iNdEx > l { 2686 return io.ErrUnexpectedEOF 2687 } 2688 return nil 2689 } 2690 func (m *EchoInRequest) Unmarshal(dAtA []byte) error { 2691 l := len(dAtA) 2692 iNdEx := 0 2693 for iNdEx < l { 2694 preIndex := iNdEx 2695 var wire uint64 2696 for shift := uint(0); ; shift += 7 { 2697 if shift >= 64 { 2698 return ErrIntOverflowExample 2699 } 2700 if iNdEx >= l { 2701 return io.ErrUnexpectedEOF 2702 } 2703 b := dAtA[iNdEx] 2704 iNdEx++ 2705 wire |= uint64(b&0x7F) << shift 2706 if b < 0x80 { 2707 break 2708 } 2709 } 2710 fieldNum := int32(wire >> 3) 2711 wireType := int(wire & 0x7) 2712 if wireType == 4 { 2713 return fmt.Errorf("proto: EchoInRequest: wiretype end group for non-group") 2714 } 2715 if fieldNum <= 0 { 2716 return fmt.Errorf("proto: EchoInRequest: illegal tag %d (wire type %d)", fieldNum, wire) 2717 } 2718 switch fieldNum { 2719 case 1: 2720 if wireType != 2 { 2721 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 2722 } 2723 var stringLen uint64 2724 for shift := uint(0); ; shift += 7 { 2725 if shift >= 64 { 2726 return ErrIntOverflowExample 2727 } 2728 if iNdEx >= l { 2729 return io.ErrUnexpectedEOF 2730 } 2731 b := dAtA[iNdEx] 2732 iNdEx++ 2733 stringLen |= uint64(b&0x7F) << shift 2734 if b < 0x80 { 2735 break 2736 } 2737 } 2738 intStringLen := int(stringLen) 2739 if intStringLen < 0 { 2740 return ErrInvalidLengthExample 2741 } 2742 postIndex := iNdEx + intStringLen 2743 if postIndex < 0 { 2744 return ErrInvalidLengthExample 2745 } 2746 if postIndex > l { 2747 return io.ErrUnexpectedEOF 2748 } 2749 m.Message = string(dAtA[iNdEx:postIndex]) 2750 iNdEx = postIndex 2751 case 2: 2752 if wireType != 0 { 2753 return fmt.Errorf("proto: wrong wireType = %d for field NumResponses", wireType) 2754 } 2755 m.NumResponses = 0 2756 for shift := uint(0); ; shift += 7 { 2757 if shift >= 64 { 2758 return ErrIntOverflowExample 2759 } 2760 if iNdEx >= l { 2761 return io.ErrUnexpectedEOF 2762 } 2763 b := dAtA[iNdEx] 2764 iNdEx++ 2765 m.NumResponses |= int64(b&0x7F) << shift 2766 if b < 0x80 { 2767 break 2768 } 2769 } 2770 default: 2771 iNdEx = preIndex 2772 skippy, err := skipExample(dAtA[iNdEx:]) 2773 if err != nil { 2774 return err 2775 } 2776 if skippy < 0 { 2777 return ErrInvalidLengthExample 2778 } 2779 if (iNdEx + skippy) < 0 { 2780 return ErrInvalidLengthExample 2781 } 2782 if (iNdEx + skippy) > l { 2783 return io.ErrUnexpectedEOF 2784 } 2785 iNdEx += skippy 2786 } 2787 } 2788 2789 if iNdEx > l { 2790 return io.ErrUnexpectedEOF 2791 } 2792 return nil 2793 } 2794 func (m *EchoInResponse) Unmarshal(dAtA []byte) error { 2795 l := len(dAtA) 2796 iNdEx := 0 2797 for iNdEx < l { 2798 preIndex := iNdEx 2799 var wire uint64 2800 for shift := uint(0); ; shift += 7 { 2801 if shift >= 64 { 2802 return ErrIntOverflowExample 2803 } 2804 if iNdEx >= l { 2805 return io.ErrUnexpectedEOF 2806 } 2807 b := dAtA[iNdEx] 2808 iNdEx++ 2809 wire |= uint64(b&0x7F) << shift 2810 if b < 0x80 { 2811 break 2812 } 2813 } 2814 fieldNum := int32(wire >> 3) 2815 wireType := int(wire & 0x7) 2816 if wireType == 4 { 2817 return fmt.Errorf("proto: EchoInResponse: wiretype end group for non-group") 2818 } 2819 if fieldNum <= 0 { 2820 return fmt.Errorf("proto: EchoInResponse: illegal tag %d (wire type %d)", fieldNum, wire) 2821 } 2822 switch fieldNum { 2823 case 1: 2824 if wireType != 2 { 2825 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 2826 } 2827 var stringLen uint64 2828 for shift := uint(0); ; shift += 7 { 2829 if shift >= 64 { 2830 return ErrIntOverflowExample 2831 } 2832 if iNdEx >= l { 2833 return io.ErrUnexpectedEOF 2834 } 2835 b := dAtA[iNdEx] 2836 iNdEx++ 2837 stringLen |= uint64(b&0x7F) << shift 2838 if b < 0x80 { 2839 break 2840 } 2841 } 2842 intStringLen := int(stringLen) 2843 if intStringLen < 0 { 2844 return ErrInvalidLengthExample 2845 } 2846 postIndex := iNdEx + intStringLen 2847 if postIndex < 0 { 2848 return ErrInvalidLengthExample 2849 } 2850 if postIndex > l { 2851 return io.ErrUnexpectedEOF 2852 } 2853 m.Message = string(dAtA[iNdEx:postIndex]) 2854 iNdEx = postIndex 2855 default: 2856 iNdEx = preIndex 2857 skippy, err := skipExample(dAtA[iNdEx:]) 2858 if err != nil { 2859 return err 2860 } 2861 if skippy < 0 { 2862 return ErrInvalidLengthExample 2863 } 2864 if (iNdEx + skippy) < 0 { 2865 return ErrInvalidLengthExample 2866 } 2867 if (iNdEx + skippy) > l { 2868 return io.ErrUnexpectedEOF 2869 } 2870 iNdEx += skippy 2871 } 2872 } 2873 2874 if iNdEx > l { 2875 return io.ErrUnexpectedEOF 2876 } 2877 return nil 2878 } 2879 func (m *EchoBothRequest) Unmarshal(dAtA []byte) error { 2880 l := len(dAtA) 2881 iNdEx := 0 2882 for iNdEx < l { 2883 preIndex := iNdEx 2884 var wire uint64 2885 for shift := uint(0); ; shift += 7 { 2886 if shift >= 64 { 2887 return ErrIntOverflowExample 2888 } 2889 if iNdEx >= l { 2890 return io.ErrUnexpectedEOF 2891 } 2892 b := dAtA[iNdEx] 2893 iNdEx++ 2894 wire |= uint64(b&0x7F) << shift 2895 if b < 0x80 { 2896 break 2897 } 2898 } 2899 fieldNum := int32(wire >> 3) 2900 wireType := int(wire & 0x7) 2901 if wireType == 4 { 2902 return fmt.Errorf("proto: EchoBothRequest: wiretype end group for non-group") 2903 } 2904 if fieldNum <= 0 { 2905 return fmt.Errorf("proto: EchoBothRequest: illegal tag %d (wire type %d)", fieldNum, wire) 2906 } 2907 switch fieldNum { 2908 case 1: 2909 if wireType != 2 { 2910 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 2911 } 2912 var stringLen uint64 2913 for shift := uint(0); ; shift += 7 { 2914 if shift >= 64 { 2915 return ErrIntOverflowExample 2916 } 2917 if iNdEx >= l { 2918 return io.ErrUnexpectedEOF 2919 } 2920 b := dAtA[iNdEx] 2921 iNdEx++ 2922 stringLen |= uint64(b&0x7F) << shift 2923 if b < 0x80 { 2924 break 2925 } 2926 } 2927 intStringLen := int(stringLen) 2928 if intStringLen < 0 { 2929 return ErrInvalidLengthExample 2930 } 2931 postIndex := iNdEx + intStringLen 2932 if postIndex < 0 { 2933 return ErrInvalidLengthExample 2934 } 2935 if postIndex > l { 2936 return io.ErrUnexpectedEOF 2937 } 2938 m.Message = string(dAtA[iNdEx:postIndex]) 2939 iNdEx = postIndex 2940 case 2: 2941 if wireType != 0 { 2942 return fmt.Errorf("proto: wrong wireType = %d for field NumResponses", wireType) 2943 } 2944 m.NumResponses = 0 2945 for shift := uint(0); ; shift += 7 { 2946 if shift >= 64 { 2947 return ErrIntOverflowExample 2948 } 2949 if iNdEx >= l { 2950 return io.ErrUnexpectedEOF 2951 } 2952 b := dAtA[iNdEx] 2953 iNdEx++ 2954 m.NumResponses |= int64(b&0x7F) << shift 2955 if b < 0x80 { 2956 break 2957 } 2958 } 2959 default: 2960 iNdEx = preIndex 2961 skippy, err := skipExample(dAtA[iNdEx:]) 2962 if err != nil { 2963 return err 2964 } 2965 if skippy < 0 { 2966 return ErrInvalidLengthExample 2967 } 2968 if (iNdEx + skippy) < 0 { 2969 return ErrInvalidLengthExample 2970 } 2971 if (iNdEx + skippy) > l { 2972 return io.ErrUnexpectedEOF 2973 } 2974 iNdEx += skippy 2975 } 2976 } 2977 2978 if iNdEx > l { 2979 return io.ErrUnexpectedEOF 2980 } 2981 return nil 2982 } 2983 func (m *EchoBothResponse) Unmarshal(dAtA []byte) error { 2984 l := len(dAtA) 2985 iNdEx := 0 2986 for iNdEx < l { 2987 preIndex := iNdEx 2988 var wire uint64 2989 for shift := uint(0); ; shift += 7 { 2990 if shift >= 64 { 2991 return ErrIntOverflowExample 2992 } 2993 if iNdEx >= l { 2994 return io.ErrUnexpectedEOF 2995 } 2996 b := dAtA[iNdEx] 2997 iNdEx++ 2998 wire |= uint64(b&0x7F) << shift 2999 if b < 0x80 { 3000 break 3001 } 3002 } 3003 fieldNum := int32(wire >> 3) 3004 wireType := int(wire & 0x7) 3005 if wireType == 4 { 3006 return fmt.Errorf("proto: EchoBothResponse: wiretype end group for non-group") 3007 } 3008 if fieldNum <= 0 { 3009 return fmt.Errorf("proto: EchoBothResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3010 } 3011 switch fieldNum { 3012 case 1: 3013 if wireType != 2 { 3014 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 3015 } 3016 var stringLen uint64 3017 for shift := uint(0); ; shift += 7 { 3018 if shift >= 64 { 3019 return ErrIntOverflowExample 3020 } 3021 if iNdEx >= l { 3022 return io.ErrUnexpectedEOF 3023 } 3024 b := dAtA[iNdEx] 3025 iNdEx++ 3026 stringLen |= uint64(b&0x7F) << shift 3027 if b < 0x80 { 3028 break 3029 } 3030 } 3031 intStringLen := int(stringLen) 3032 if intStringLen < 0 { 3033 return ErrInvalidLengthExample 3034 } 3035 postIndex := iNdEx + intStringLen 3036 if postIndex < 0 { 3037 return ErrInvalidLengthExample 3038 } 3039 if postIndex > l { 3040 return io.ErrUnexpectedEOF 3041 } 3042 m.Message = string(dAtA[iNdEx:postIndex]) 3043 iNdEx = postIndex 3044 default: 3045 iNdEx = preIndex 3046 skippy, err := skipExample(dAtA[iNdEx:]) 3047 if err != nil { 3048 return err 3049 } 3050 if skippy < 0 { 3051 return ErrInvalidLengthExample 3052 } 3053 if (iNdEx + skippy) < 0 { 3054 return ErrInvalidLengthExample 3055 } 3056 if (iNdEx + skippy) > l { 3057 return io.ErrUnexpectedEOF 3058 } 3059 iNdEx += skippy 3060 } 3061 } 3062 3063 if iNdEx > l { 3064 return io.ErrUnexpectedEOF 3065 } 3066 return nil 3067 } 3068 func (m *Get2NdMessageRequest) Unmarshal(dAtA []byte) error { 3069 l := len(dAtA) 3070 iNdEx := 0 3071 for iNdEx < l { 3072 preIndex := iNdEx 3073 var wire uint64 3074 for shift := uint(0); ; shift += 7 { 3075 if shift >= 64 { 3076 return ErrIntOverflowExample 3077 } 3078 if iNdEx >= l { 3079 return io.ErrUnexpectedEOF 3080 } 3081 b := dAtA[iNdEx] 3082 iNdEx++ 3083 wire |= uint64(b&0x7F) << shift 3084 if b < 0x80 { 3085 break 3086 } 3087 } 3088 fieldNum := int32(wire >> 3) 3089 wireType := int(wire & 0x7) 3090 if wireType == 4 { 3091 return fmt.Errorf("proto: Get2ndMessageRequest: wiretype end group for non-group") 3092 } 3093 if fieldNum <= 0 { 3094 return fmt.Errorf("proto: Get2ndMessageRequest: illegal tag %d (wire type %d)", fieldNum, wire) 3095 } 3096 switch fieldNum { 3097 case 1: 3098 if wireType != 2 { 3099 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 3100 } 3101 var stringLen uint64 3102 for shift := uint(0); ; shift += 7 { 3103 if shift >= 64 { 3104 return ErrIntOverflowExample 3105 } 3106 if iNdEx >= l { 3107 return io.ErrUnexpectedEOF 3108 } 3109 b := dAtA[iNdEx] 3110 iNdEx++ 3111 stringLen |= uint64(b&0x7F) << shift 3112 if b < 0x80 { 3113 break 3114 } 3115 } 3116 intStringLen := int(stringLen) 3117 if intStringLen < 0 { 3118 return ErrInvalidLengthExample 3119 } 3120 postIndex := iNdEx + intStringLen 3121 if postIndex < 0 { 3122 return ErrInvalidLengthExample 3123 } 3124 if postIndex > l { 3125 return io.ErrUnexpectedEOF 3126 } 3127 m.Message = string(dAtA[iNdEx:postIndex]) 3128 iNdEx = postIndex 3129 default: 3130 iNdEx = preIndex 3131 skippy, err := skipExample(dAtA[iNdEx:]) 3132 if err != nil { 3133 return err 3134 } 3135 if skippy < 0 { 3136 return ErrInvalidLengthExample 3137 } 3138 if (iNdEx + skippy) < 0 { 3139 return ErrInvalidLengthExample 3140 } 3141 if (iNdEx + skippy) > l { 3142 return io.ErrUnexpectedEOF 3143 } 3144 iNdEx += skippy 3145 } 3146 } 3147 3148 if iNdEx > l { 3149 return io.ErrUnexpectedEOF 3150 } 3151 return nil 3152 } 3153 func (m *Get2NdMessageResponse) Unmarshal(dAtA []byte) error { 3154 l := len(dAtA) 3155 iNdEx := 0 3156 for iNdEx < l { 3157 preIndex := iNdEx 3158 var wire uint64 3159 for shift := uint(0); ; shift += 7 { 3160 if shift >= 64 { 3161 return ErrIntOverflowExample 3162 } 3163 if iNdEx >= l { 3164 return io.ErrUnexpectedEOF 3165 } 3166 b := dAtA[iNdEx] 3167 iNdEx++ 3168 wire |= uint64(b&0x7F) << shift 3169 if b < 0x80 { 3170 break 3171 } 3172 } 3173 fieldNum := int32(wire >> 3) 3174 wireType := int(wire & 0x7) 3175 if wireType == 4 { 3176 return fmt.Errorf("proto: Get2ndMessageResponse: wiretype end group for non-group") 3177 } 3178 if fieldNum <= 0 { 3179 return fmt.Errorf("proto: Get2ndMessageResponse: illegal tag %d (wire type %d)", fieldNum, wire) 3180 } 3181 switch fieldNum { 3182 case 1: 3183 if wireType != 2 { 3184 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 3185 } 3186 var stringLen uint64 3187 for shift := uint(0); ; shift += 7 { 3188 if shift >= 64 { 3189 return ErrIntOverflowExample 3190 } 3191 if iNdEx >= l { 3192 return io.ErrUnexpectedEOF 3193 } 3194 b := dAtA[iNdEx] 3195 iNdEx++ 3196 stringLen |= uint64(b&0x7F) << shift 3197 if b < 0x80 { 3198 break 3199 } 3200 } 3201 intStringLen := int(stringLen) 3202 if intStringLen < 0 { 3203 return ErrInvalidLengthExample 3204 } 3205 postIndex := iNdEx + intStringLen 3206 if postIndex < 0 { 3207 return ErrInvalidLengthExample 3208 } 3209 if postIndex > l { 3210 return io.ErrUnexpectedEOF 3211 } 3212 m.Message = string(dAtA[iNdEx:postIndex]) 3213 iNdEx = postIndex 3214 default: 3215 iNdEx = preIndex 3216 skippy, err := skipExample(dAtA[iNdEx:]) 3217 if err != nil { 3218 return err 3219 } 3220 if skippy < 0 { 3221 return ErrInvalidLengthExample 3222 } 3223 if (iNdEx + skippy) < 0 { 3224 return ErrInvalidLengthExample 3225 } 3226 if (iNdEx + skippy) > l { 3227 return io.ErrUnexpectedEOF 3228 } 3229 iNdEx += skippy 3230 } 3231 } 3232 3233 if iNdEx > l { 3234 return io.ErrUnexpectedEOF 3235 } 3236 return nil 3237 } 3238 func skipExample(dAtA []byte) (n int, err error) { 3239 l := len(dAtA) 3240 iNdEx := 0 3241 depth := 0 3242 for iNdEx < l { 3243 var wire uint64 3244 for shift := uint(0); ; shift += 7 { 3245 if shift >= 64 { 3246 return 0, ErrIntOverflowExample 3247 } 3248 if iNdEx >= l { 3249 return 0, io.ErrUnexpectedEOF 3250 } 3251 b := dAtA[iNdEx] 3252 iNdEx++ 3253 wire |= (uint64(b) & 0x7F) << shift 3254 if b < 0x80 { 3255 break 3256 } 3257 } 3258 wireType := int(wire & 0x7) 3259 switch wireType { 3260 case 0: 3261 for shift := uint(0); ; shift += 7 { 3262 if shift >= 64 { 3263 return 0, ErrIntOverflowExample 3264 } 3265 if iNdEx >= l { 3266 return 0, io.ErrUnexpectedEOF 3267 } 3268 iNdEx++ 3269 if dAtA[iNdEx-1] < 0x80 { 3270 break 3271 } 3272 } 3273 case 1: 3274 iNdEx += 8 3275 case 2: 3276 var length int 3277 for shift := uint(0); ; shift += 7 { 3278 if shift >= 64 { 3279 return 0, ErrIntOverflowExample 3280 } 3281 if iNdEx >= l { 3282 return 0, io.ErrUnexpectedEOF 3283 } 3284 b := dAtA[iNdEx] 3285 iNdEx++ 3286 length |= (int(b) & 0x7F) << shift 3287 if b < 0x80 { 3288 break 3289 } 3290 } 3291 if length < 0 { 3292 return 0, ErrInvalidLengthExample 3293 } 3294 iNdEx += length 3295 case 3: 3296 depth++ 3297 case 4: 3298 if depth == 0 { 3299 return 0, ErrUnexpectedEndOfGroupExample 3300 } 3301 depth-- 3302 case 5: 3303 iNdEx += 4 3304 default: 3305 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 3306 } 3307 if iNdEx < 0 { 3308 return 0, ErrInvalidLengthExample 3309 } 3310 if depth == 0 { 3311 return iNdEx, nil 3312 } 3313 } 3314 return 0, io.ErrUnexpectedEOF 3315 } 3316 3317 var ( 3318 ErrInvalidLengthExample = fmt.Errorf("proto: negative length found during unmarshaling") 3319 ErrIntOverflowExample = fmt.Errorf("proto: integer overflow") 3320 ErrUnexpectedEndOfGroupExample = fmt.Errorf("proto: unexpected end of group") 3321 )