github.com/onosproject/onos-api/go@v0.10.32/onos/perf/perf.pb.go (about) 1 // Code generated by protoc-gen-gogo. DO NOT EDIT. 2 // source: onos/perf/perf.proto 3 4 // Package onos.perf defines interfaces for benchmarking gRPC 5 6 package topo 7 8 import ( 9 context "context" 10 fmt "fmt" 11 proto "github.com/gogo/protobuf/proto" 12 grpc "google.golang.org/grpc" 13 codes "google.golang.org/grpc/codes" 14 status "google.golang.org/grpc/status" 15 io "io" 16 math "math" 17 math_bits "math/bits" 18 ) 19 20 // Reference imports to suppress errors if they are not otherwise used. 21 var _ = proto.Marshal 22 var _ = fmt.Errorf 23 var _ = math.Inf 24 25 // This is a compile-time assertion to ensure that this generated file 26 // is compatible with the proto package it is being compiled against. 27 // A compilation error at this line likely means your copy of the 28 // proto package needs to be updated. 29 const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package 30 31 type Data struct { 32 Length uint32 `protobuf:"varint,1,opt,name=length,proto3" json:"length,omitempty"` 33 Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` 34 } 35 36 func (m *Data) Reset() { *m = Data{} } 37 func (m *Data) String() string { return proto.CompactTextString(m) } 38 func (*Data) ProtoMessage() {} 39 func (*Data) Descriptor() ([]byte, []int) { 40 return fileDescriptor_e92bef58601c6f0d, []int{0} 41 } 42 func (m *Data) XXX_Unmarshal(b []byte) error { 43 return m.Unmarshal(b) 44 } 45 func (m *Data) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 46 if deterministic { 47 return xxx_messageInfo_Data.Marshal(b, m, deterministic) 48 } else { 49 b = b[:cap(b)] 50 n, err := m.MarshalToSizedBuffer(b) 51 if err != nil { 52 return nil, err 53 } 54 return b[:n], nil 55 } 56 } 57 func (m *Data) XXX_Merge(src proto.Message) { 58 xxx_messageInfo_Data.Merge(m, src) 59 } 60 func (m *Data) XXX_Size() int { 61 return m.Size() 62 } 63 func (m *Data) XXX_DiscardUnknown() { 64 xxx_messageInfo_Data.DiscardUnknown(m) 65 } 66 67 var xxx_messageInfo_Data proto.InternalMessageInfo 68 69 func (m *Data) GetLength() uint32 { 70 if m != nil { 71 return m.Length 72 } 73 return 0 74 } 75 76 func (m *Data) GetData() []byte { 77 if m != nil { 78 return m.Data 79 } 80 return nil 81 } 82 83 type PingRequest struct { 84 Payload *Data `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` 85 Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 86 RepeatCount uint32 `protobuf:"varint,3,opt,name=repeatCount,proto3" json:"repeatCount,omitempty"` 87 } 88 89 func (m *PingRequest) Reset() { *m = PingRequest{} } 90 func (m *PingRequest) String() string { return proto.CompactTextString(m) } 91 func (*PingRequest) ProtoMessage() {} 92 func (*PingRequest) Descriptor() ([]byte, []int) { 93 return fileDescriptor_e92bef58601c6f0d, []int{1} 94 } 95 func (m *PingRequest) XXX_Unmarshal(b []byte) error { 96 return m.Unmarshal(b) 97 } 98 func (m *PingRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 99 if deterministic { 100 return xxx_messageInfo_PingRequest.Marshal(b, m, deterministic) 101 } else { 102 b = b[:cap(b)] 103 n, err := m.MarshalToSizedBuffer(b) 104 if err != nil { 105 return nil, err 106 } 107 return b[:n], nil 108 } 109 } 110 func (m *PingRequest) XXX_Merge(src proto.Message) { 111 xxx_messageInfo_PingRequest.Merge(m, src) 112 } 113 func (m *PingRequest) XXX_Size() int { 114 return m.Size() 115 } 116 func (m *PingRequest) XXX_DiscardUnknown() { 117 xxx_messageInfo_PingRequest.DiscardUnknown(m) 118 } 119 120 var xxx_messageInfo_PingRequest proto.InternalMessageInfo 121 122 func (m *PingRequest) GetPayload() *Data { 123 if m != nil { 124 return m.Payload 125 } 126 return nil 127 } 128 129 func (m *PingRequest) GetTimestamp() uint64 { 130 if m != nil { 131 return m.Timestamp 132 } 133 return 0 134 } 135 136 func (m *PingRequest) GetRepeatCount() uint32 { 137 if m != nil { 138 return m.RepeatCount 139 } 140 return 0 141 } 142 143 type PingResponse struct { 144 Payload *Data `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` 145 Timestamp uint64 `protobuf:"varint,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` 146 } 147 148 func (m *PingResponse) Reset() { *m = PingResponse{} } 149 func (m *PingResponse) String() string { return proto.CompactTextString(m) } 150 func (*PingResponse) ProtoMessage() {} 151 func (*PingResponse) Descriptor() ([]byte, []int) { 152 return fileDescriptor_e92bef58601c6f0d, []int{2} 153 } 154 func (m *PingResponse) XXX_Unmarshal(b []byte) error { 155 return m.Unmarshal(b) 156 } 157 func (m *PingResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { 158 if deterministic { 159 return xxx_messageInfo_PingResponse.Marshal(b, m, deterministic) 160 } else { 161 b = b[:cap(b)] 162 n, err := m.MarshalToSizedBuffer(b) 163 if err != nil { 164 return nil, err 165 } 166 return b[:n], nil 167 } 168 } 169 func (m *PingResponse) XXX_Merge(src proto.Message) { 170 xxx_messageInfo_PingResponse.Merge(m, src) 171 } 172 func (m *PingResponse) XXX_Size() int { 173 return m.Size() 174 } 175 func (m *PingResponse) XXX_DiscardUnknown() { 176 xxx_messageInfo_PingResponse.DiscardUnknown(m) 177 } 178 179 var xxx_messageInfo_PingResponse proto.InternalMessageInfo 180 181 func (m *PingResponse) GetPayload() *Data { 182 if m != nil { 183 return m.Payload 184 } 185 return nil 186 } 187 188 func (m *PingResponse) GetTimestamp() uint64 { 189 if m != nil { 190 return m.Timestamp 191 } 192 return 0 193 } 194 195 func init() { 196 proto.RegisterType((*Data)(nil), "onos.perf.Data") 197 proto.RegisterType((*PingRequest)(nil), "onos.perf.PingRequest") 198 proto.RegisterType((*PingResponse)(nil), "onos.perf.PingResponse") 199 } 200 201 func init() { proto.RegisterFile("onos/perf/perf.proto", fileDescriptor_e92bef58601c6f0d) } 202 203 var fileDescriptor_e92bef58601c6f0d = []byte{ 204 // 276 bytes of a gzipped FileDescriptorProto 205 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0xc9, 0xcf, 0xcb, 0x2f, 206 0xd6, 0x2f, 0x48, 0x2d, 0x4a, 0x03, 0x13, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x9c, 0x20, 207 0x51, 0x3d, 0x90, 0x80, 0x92, 0x11, 0x17, 0x8b, 0x4b, 0x62, 0x49, 0xa2, 0x90, 0x18, 0x17, 0x5b, 208 0x4e, 0x6a, 0x5e, 0x7a, 0x49, 0x86, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x6f, 0x10, 0x94, 0x27, 0x24, 209 0xc4, 0xc5, 0x92, 0x92, 0x58, 0x92, 0x28, 0xc1, 0xa4, 0xc0, 0xa8, 0xc1, 0x13, 0x04, 0x66, 0x2b, 210 0x55, 0x70, 0x71, 0x07, 0x64, 0xe6, 0xa5, 0x07, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x08, 0x69, 211 0x72, 0xb1, 0x17, 0x24, 0x56, 0xe6, 0xe4, 0x27, 0xa6, 0x80, 0xf5, 0x72, 0x1b, 0xf1, 0xeb, 0xc1, 212 0xcd, 0xd7, 0x03, 0x19, 0x1e, 0x04, 0x93, 0x17, 0x92, 0xe1, 0xe2, 0x2c, 0xc9, 0xcc, 0x4d, 0x2d, 213 0x2e, 0x49, 0xcc, 0x2d, 0x00, 0x1b, 0xc9, 0x12, 0x84, 0x10, 0x10, 0x52, 0xe0, 0xe2, 0x2e, 0x4a, 214 0x2d, 0x48, 0x4d, 0x2c, 0x71, 0xce, 0x2f, 0xcd, 0x2b, 0x91, 0x60, 0x06, 0x3b, 0x04, 0x59, 0x48, 215 0x29, 0x9c, 0x8b, 0x07, 0x62, 0x73, 0x71, 0x41, 0x7e, 0x5e, 0x71, 0x2a, 0xd5, 0xac, 0x36, 0xea, 216 0x65, 0xe4, 0xe2, 0x0e, 0x48, 0x2d, 0x4a, 0x0b, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0x15, 0xb2, 217 0xe4, 0x62, 0x01, 0x59, 0x24, 0x24, 0x86, 0x64, 0x1e, 0x92, 0x9f, 0xa5, 0xc4, 0x31, 0xc4, 0x21, 218 0x2e, 0x52, 0x62, 0x10, 0x72, 0xe6, 0xe2, 0x02, 0x89, 0x04, 0x97, 0x14, 0xa5, 0x26, 0xe6, 0x92, 219 0x61, 0x80, 0x06, 0xa3, 0x01, 0xa3, 0x93, 0xc4, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 220 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 221 0x31, 0x24, 0xb1, 0x81, 0xa3, 0xd0, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x39, 0xf8, 0xcc, 0x7b, 222 0xda, 0x01, 0x00, 0x00, 223 } 224 225 // Reference imports to suppress errors if they are not otherwise used. 226 var _ context.Context 227 var _ grpc.ClientConn 228 229 // This is a compile-time assertion to ensure that this generated file 230 // is compatible with the grpc package it is being compiled against. 231 const _ = grpc.SupportPackageIsVersion4 232 233 // PerfServiceClient is the client API for PerfService service. 234 // 235 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. 236 type PerfServiceClient interface { 237 Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) 238 PingStream(ctx context.Context, opts ...grpc.CallOption) (PerfService_PingStreamClient, error) 239 } 240 241 type perfServiceClient struct { 242 cc *grpc.ClientConn 243 } 244 245 func NewPerfServiceClient(cc *grpc.ClientConn) PerfServiceClient { 246 return &perfServiceClient{cc} 247 } 248 249 func (c *perfServiceClient) Ping(ctx context.Context, in *PingRequest, opts ...grpc.CallOption) (*PingResponse, error) { 250 out := new(PingResponse) 251 err := c.cc.Invoke(ctx, "/onos.perf.PerfService/Ping", in, out, opts...) 252 if err != nil { 253 return nil, err 254 } 255 return out, nil 256 } 257 258 func (c *perfServiceClient) PingStream(ctx context.Context, opts ...grpc.CallOption) (PerfService_PingStreamClient, error) { 259 stream, err := c.cc.NewStream(ctx, &_PerfService_serviceDesc.Streams[0], "/onos.perf.PerfService/PingStream", opts...) 260 if err != nil { 261 return nil, err 262 } 263 x := &perfServicePingStreamClient{stream} 264 return x, nil 265 } 266 267 type PerfService_PingStreamClient interface { 268 Send(*PingRequest) error 269 Recv() (*PingResponse, error) 270 grpc.ClientStream 271 } 272 273 type perfServicePingStreamClient struct { 274 grpc.ClientStream 275 } 276 277 func (x *perfServicePingStreamClient) Send(m *PingRequest) error { 278 return x.ClientStream.SendMsg(m) 279 } 280 281 func (x *perfServicePingStreamClient) Recv() (*PingResponse, error) { 282 m := new(PingResponse) 283 if err := x.ClientStream.RecvMsg(m); err != nil { 284 return nil, err 285 } 286 return m, nil 287 } 288 289 // PerfServiceServer is the server API for PerfService service. 290 type PerfServiceServer interface { 291 Ping(context.Context, *PingRequest) (*PingResponse, error) 292 PingStream(PerfService_PingStreamServer) error 293 } 294 295 // UnimplementedPerfServiceServer can be embedded to have forward compatible implementations. 296 type UnimplementedPerfServiceServer struct { 297 } 298 299 func (*UnimplementedPerfServiceServer) Ping(ctx context.Context, req *PingRequest) (*PingResponse, error) { 300 return nil, status.Errorf(codes.Unimplemented, "method Ping not implemented") 301 } 302 func (*UnimplementedPerfServiceServer) PingStream(srv PerfService_PingStreamServer) error { 303 return status.Errorf(codes.Unimplemented, "method PingStream not implemented") 304 } 305 306 func RegisterPerfServiceServer(s *grpc.Server, srv PerfServiceServer) { 307 s.RegisterService(&_PerfService_serviceDesc, srv) 308 } 309 310 func _PerfService_Ping_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { 311 in := new(PingRequest) 312 if err := dec(in); err != nil { 313 return nil, err 314 } 315 if interceptor == nil { 316 return srv.(PerfServiceServer).Ping(ctx, in) 317 } 318 info := &grpc.UnaryServerInfo{ 319 Server: srv, 320 FullMethod: "/onos.perf.PerfService/Ping", 321 } 322 handler := func(ctx context.Context, req interface{}) (interface{}, error) { 323 return srv.(PerfServiceServer).Ping(ctx, req.(*PingRequest)) 324 } 325 return interceptor(ctx, in, info, handler) 326 } 327 328 func _PerfService_PingStream_Handler(srv interface{}, stream grpc.ServerStream) error { 329 return srv.(PerfServiceServer).PingStream(&perfServicePingStreamServer{stream}) 330 } 331 332 type PerfService_PingStreamServer interface { 333 Send(*PingResponse) error 334 Recv() (*PingRequest, error) 335 grpc.ServerStream 336 } 337 338 type perfServicePingStreamServer struct { 339 grpc.ServerStream 340 } 341 342 func (x *perfServicePingStreamServer) Send(m *PingResponse) error { 343 return x.ServerStream.SendMsg(m) 344 } 345 346 func (x *perfServicePingStreamServer) Recv() (*PingRequest, error) { 347 m := new(PingRequest) 348 if err := x.ServerStream.RecvMsg(m); err != nil { 349 return nil, err 350 } 351 return m, nil 352 } 353 354 var _PerfService_serviceDesc = grpc.ServiceDesc{ 355 ServiceName: "onos.perf.PerfService", 356 HandlerType: (*PerfServiceServer)(nil), 357 Methods: []grpc.MethodDesc{ 358 { 359 MethodName: "Ping", 360 Handler: _PerfService_Ping_Handler, 361 }, 362 }, 363 Streams: []grpc.StreamDesc{ 364 { 365 StreamName: "PingStream", 366 Handler: _PerfService_PingStream_Handler, 367 ServerStreams: true, 368 ClientStreams: true, 369 }, 370 }, 371 Metadata: "onos/perf/perf.proto", 372 } 373 374 func (m *Data) Marshal() (dAtA []byte, err error) { 375 size := m.Size() 376 dAtA = make([]byte, size) 377 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 378 if err != nil { 379 return nil, err 380 } 381 return dAtA[:n], nil 382 } 383 384 func (m *Data) MarshalTo(dAtA []byte) (int, error) { 385 size := m.Size() 386 return m.MarshalToSizedBuffer(dAtA[:size]) 387 } 388 389 func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { 390 i := len(dAtA) 391 _ = i 392 var l int 393 _ = l 394 if len(m.Data) > 0 { 395 i -= len(m.Data) 396 copy(dAtA[i:], m.Data) 397 i = encodeVarintPerf(dAtA, i, uint64(len(m.Data))) 398 i-- 399 dAtA[i] = 0x12 400 } 401 if m.Length != 0 { 402 i = encodeVarintPerf(dAtA, i, uint64(m.Length)) 403 i-- 404 dAtA[i] = 0x8 405 } 406 return len(dAtA) - i, nil 407 } 408 409 func (m *PingRequest) Marshal() (dAtA []byte, err error) { 410 size := m.Size() 411 dAtA = make([]byte, size) 412 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 413 if err != nil { 414 return nil, err 415 } 416 return dAtA[:n], nil 417 } 418 419 func (m *PingRequest) MarshalTo(dAtA []byte) (int, error) { 420 size := m.Size() 421 return m.MarshalToSizedBuffer(dAtA[:size]) 422 } 423 424 func (m *PingRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { 425 i := len(dAtA) 426 _ = i 427 var l int 428 _ = l 429 if m.RepeatCount != 0 { 430 i = encodeVarintPerf(dAtA, i, uint64(m.RepeatCount)) 431 i-- 432 dAtA[i] = 0x18 433 } 434 if m.Timestamp != 0 { 435 i = encodeVarintPerf(dAtA, i, uint64(m.Timestamp)) 436 i-- 437 dAtA[i] = 0x10 438 } 439 if m.Payload != nil { 440 { 441 size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) 442 if err != nil { 443 return 0, err 444 } 445 i -= size 446 i = encodeVarintPerf(dAtA, i, uint64(size)) 447 } 448 i-- 449 dAtA[i] = 0xa 450 } 451 return len(dAtA) - i, nil 452 } 453 454 func (m *PingResponse) Marshal() (dAtA []byte, err error) { 455 size := m.Size() 456 dAtA = make([]byte, size) 457 n, err := m.MarshalToSizedBuffer(dAtA[:size]) 458 if err != nil { 459 return nil, err 460 } 461 return dAtA[:n], nil 462 } 463 464 func (m *PingResponse) MarshalTo(dAtA []byte) (int, error) { 465 size := m.Size() 466 return m.MarshalToSizedBuffer(dAtA[:size]) 467 } 468 469 func (m *PingResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { 470 i := len(dAtA) 471 _ = i 472 var l int 473 _ = l 474 if m.Timestamp != 0 { 475 i = encodeVarintPerf(dAtA, i, uint64(m.Timestamp)) 476 i-- 477 dAtA[i] = 0x10 478 } 479 if m.Payload != nil { 480 { 481 size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) 482 if err != nil { 483 return 0, err 484 } 485 i -= size 486 i = encodeVarintPerf(dAtA, i, uint64(size)) 487 } 488 i-- 489 dAtA[i] = 0xa 490 } 491 return len(dAtA) - i, nil 492 } 493 494 func encodeVarintPerf(dAtA []byte, offset int, v uint64) int { 495 offset -= sovPerf(v) 496 base := offset 497 for v >= 1<<7 { 498 dAtA[offset] = uint8(v&0x7f | 0x80) 499 v >>= 7 500 offset++ 501 } 502 dAtA[offset] = uint8(v) 503 return base 504 } 505 func (m *Data) Size() (n int) { 506 if m == nil { 507 return 0 508 } 509 var l int 510 _ = l 511 if m.Length != 0 { 512 n += 1 + sovPerf(uint64(m.Length)) 513 } 514 l = len(m.Data) 515 if l > 0 { 516 n += 1 + l + sovPerf(uint64(l)) 517 } 518 return n 519 } 520 521 func (m *PingRequest) Size() (n int) { 522 if m == nil { 523 return 0 524 } 525 var l int 526 _ = l 527 if m.Payload != nil { 528 l = m.Payload.Size() 529 n += 1 + l + sovPerf(uint64(l)) 530 } 531 if m.Timestamp != 0 { 532 n += 1 + sovPerf(uint64(m.Timestamp)) 533 } 534 if m.RepeatCount != 0 { 535 n += 1 + sovPerf(uint64(m.RepeatCount)) 536 } 537 return n 538 } 539 540 func (m *PingResponse) Size() (n int) { 541 if m == nil { 542 return 0 543 } 544 var l int 545 _ = l 546 if m.Payload != nil { 547 l = m.Payload.Size() 548 n += 1 + l + sovPerf(uint64(l)) 549 } 550 if m.Timestamp != 0 { 551 n += 1 + sovPerf(uint64(m.Timestamp)) 552 } 553 return n 554 } 555 556 func sovPerf(x uint64) (n int) { 557 return (math_bits.Len64(x|1) + 6) / 7 558 } 559 func sozPerf(x uint64) (n int) { 560 return sovPerf(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 561 } 562 func (m *Data) Unmarshal(dAtA []byte) error { 563 l := len(dAtA) 564 iNdEx := 0 565 for iNdEx < l { 566 preIndex := iNdEx 567 var wire uint64 568 for shift := uint(0); ; shift += 7 { 569 if shift >= 64 { 570 return ErrIntOverflowPerf 571 } 572 if iNdEx >= l { 573 return io.ErrUnexpectedEOF 574 } 575 b := dAtA[iNdEx] 576 iNdEx++ 577 wire |= uint64(b&0x7F) << shift 578 if b < 0x80 { 579 break 580 } 581 } 582 fieldNum := int32(wire >> 3) 583 wireType := int(wire & 0x7) 584 if wireType == 4 { 585 return fmt.Errorf("proto: Data: wiretype end group for non-group") 586 } 587 if fieldNum <= 0 { 588 return fmt.Errorf("proto: Data: illegal tag %d (wire type %d)", fieldNum, wire) 589 } 590 switch fieldNum { 591 case 1: 592 if wireType != 0 { 593 return fmt.Errorf("proto: wrong wireType = %d for field Length", wireType) 594 } 595 m.Length = 0 596 for shift := uint(0); ; shift += 7 { 597 if shift >= 64 { 598 return ErrIntOverflowPerf 599 } 600 if iNdEx >= l { 601 return io.ErrUnexpectedEOF 602 } 603 b := dAtA[iNdEx] 604 iNdEx++ 605 m.Length |= uint32(b&0x7F) << shift 606 if b < 0x80 { 607 break 608 } 609 } 610 case 2: 611 if wireType != 2 { 612 return fmt.Errorf("proto: wrong wireType = %d for field Data", wireType) 613 } 614 var byteLen int 615 for shift := uint(0); ; shift += 7 { 616 if shift >= 64 { 617 return ErrIntOverflowPerf 618 } 619 if iNdEx >= l { 620 return io.ErrUnexpectedEOF 621 } 622 b := dAtA[iNdEx] 623 iNdEx++ 624 byteLen |= int(b&0x7F) << shift 625 if b < 0x80 { 626 break 627 } 628 } 629 if byteLen < 0 { 630 return ErrInvalidLengthPerf 631 } 632 postIndex := iNdEx + byteLen 633 if postIndex < 0 { 634 return ErrInvalidLengthPerf 635 } 636 if postIndex > l { 637 return io.ErrUnexpectedEOF 638 } 639 m.Data = append(m.Data[:0], dAtA[iNdEx:postIndex]...) 640 if m.Data == nil { 641 m.Data = []byte{} 642 } 643 iNdEx = postIndex 644 default: 645 iNdEx = preIndex 646 skippy, err := skipPerf(dAtA[iNdEx:]) 647 if err != nil { 648 return err 649 } 650 if (skippy < 0) || (iNdEx+skippy) < 0 { 651 return ErrInvalidLengthPerf 652 } 653 if (iNdEx + skippy) > l { 654 return io.ErrUnexpectedEOF 655 } 656 iNdEx += skippy 657 } 658 } 659 660 if iNdEx > l { 661 return io.ErrUnexpectedEOF 662 } 663 return nil 664 } 665 func (m *PingRequest) Unmarshal(dAtA []byte) error { 666 l := len(dAtA) 667 iNdEx := 0 668 for iNdEx < l { 669 preIndex := iNdEx 670 var wire uint64 671 for shift := uint(0); ; shift += 7 { 672 if shift >= 64 { 673 return ErrIntOverflowPerf 674 } 675 if iNdEx >= l { 676 return io.ErrUnexpectedEOF 677 } 678 b := dAtA[iNdEx] 679 iNdEx++ 680 wire |= uint64(b&0x7F) << shift 681 if b < 0x80 { 682 break 683 } 684 } 685 fieldNum := int32(wire >> 3) 686 wireType := int(wire & 0x7) 687 if wireType == 4 { 688 return fmt.Errorf("proto: PingRequest: wiretype end group for non-group") 689 } 690 if fieldNum <= 0 { 691 return fmt.Errorf("proto: PingRequest: illegal tag %d (wire type %d)", fieldNum, wire) 692 } 693 switch fieldNum { 694 case 1: 695 if wireType != 2 { 696 return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) 697 } 698 var msglen int 699 for shift := uint(0); ; shift += 7 { 700 if shift >= 64 { 701 return ErrIntOverflowPerf 702 } 703 if iNdEx >= l { 704 return io.ErrUnexpectedEOF 705 } 706 b := dAtA[iNdEx] 707 iNdEx++ 708 msglen |= int(b&0x7F) << shift 709 if b < 0x80 { 710 break 711 } 712 } 713 if msglen < 0 { 714 return ErrInvalidLengthPerf 715 } 716 postIndex := iNdEx + msglen 717 if postIndex < 0 { 718 return ErrInvalidLengthPerf 719 } 720 if postIndex > l { 721 return io.ErrUnexpectedEOF 722 } 723 if m.Payload == nil { 724 m.Payload = &Data{} 725 } 726 if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 727 return err 728 } 729 iNdEx = postIndex 730 case 2: 731 if wireType != 0 { 732 return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) 733 } 734 m.Timestamp = 0 735 for shift := uint(0); ; shift += 7 { 736 if shift >= 64 { 737 return ErrIntOverflowPerf 738 } 739 if iNdEx >= l { 740 return io.ErrUnexpectedEOF 741 } 742 b := dAtA[iNdEx] 743 iNdEx++ 744 m.Timestamp |= uint64(b&0x7F) << shift 745 if b < 0x80 { 746 break 747 } 748 } 749 case 3: 750 if wireType != 0 { 751 return fmt.Errorf("proto: wrong wireType = %d for field RepeatCount", wireType) 752 } 753 m.RepeatCount = 0 754 for shift := uint(0); ; shift += 7 { 755 if shift >= 64 { 756 return ErrIntOverflowPerf 757 } 758 if iNdEx >= l { 759 return io.ErrUnexpectedEOF 760 } 761 b := dAtA[iNdEx] 762 iNdEx++ 763 m.RepeatCount |= uint32(b&0x7F) << shift 764 if b < 0x80 { 765 break 766 } 767 } 768 default: 769 iNdEx = preIndex 770 skippy, err := skipPerf(dAtA[iNdEx:]) 771 if err != nil { 772 return err 773 } 774 if (skippy < 0) || (iNdEx+skippy) < 0 { 775 return ErrInvalidLengthPerf 776 } 777 if (iNdEx + skippy) > l { 778 return io.ErrUnexpectedEOF 779 } 780 iNdEx += skippy 781 } 782 } 783 784 if iNdEx > l { 785 return io.ErrUnexpectedEOF 786 } 787 return nil 788 } 789 func (m *PingResponse) Unmarshal(dAtA []byte) error { 790 l := len(dAtA) 791 iNdEx := 0 792 for iNdEx < l { 793 preIndex := iNdEx 794 var wire uint64 795 for shift := uint(0); ; shift += 7 { 796 if shift >= 64 { 797 return ErrIntOverflowPerf 798 } 799 if iNdEx >= l { 800 return io.ErrUnexpectedEOF 801 } 802 b := dAtA[iNdEx] 803 iNdEx++ 804 wire |= uint64(b&0x7F) << shift 805 if b < 0x80 { 806 break 807 } 808 } 809 fieldNum := int32(wire >> 3) 810 wireType := int(wire & 0x7) 811 if wireType == 4 { 812 return fmt.Errorf("proto: PingResponse: wiretype end group for non-group") 813 } 814 if fieldNum <= 0 { 815 return fmt.Errorf("proto: PingResponse: illegal tag %d (wire type %d)", fieldNum, wire) 816 } 817 switch fieldNum { 818 case 1: 819 if wireType != 2 { 820 return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) 821 } 822 var msglen int 823 for shift := uint(0); ; shift += 7 { 824 if shift >= 64 { 825 return ErrIntOverflowPerf 826 } 827 if iNdEx >= l { 828 return io.ErrUnexpectedEOF 829 } 830 b := dAtA[iNdEx] 831 iNdEx++ 832 msglen |= int(b&0x7F) << shift 833 if b < 0x80 { 834 break 835 } 836 } 837 if msglen < 0 { 838 return ErrInvalidLengthPerf 839 } 840 postIndex := iNdEx + msglen 841 if postIndex < 0 { 842 return ErrInvalidLengthPerf 843 } 844 if postIndex > l { 845 return io.ErrUnexpectedEOF 846 } 847 if m.Payload == nil { 848 m.Payload = &Data{} 849 } 850 if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { 851 return err 852 } 853 iNdEx = postIndex 854 case 2: 855 if wireType != 0 { 856 return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) 857 } 858 m.Timestamp = 0 859 for shift := uint(0); ; shift += 7 { 860 if shift >= 64 { 861 return ErrIntOverflowPerf 862 } 863 if iNdEx >= l { 864 return io.ErrUnexpectedEOF 865 } 866 b := dAtA[iNdEx] 867 iNdEx++ 868 m.Timestamp |= uint64(b&0x7F) << shift 869 if b < 0x80 { 870 break 871 } 872 } 873 default: 874 iNdEx = preIndex 875 skippy, err := skipPerf(dAtA[iNdEx:]) 876 if err != nil { 877 return err 878 } 879 if (skippy < 0) || (iNdEx+skippy) < 0 { 880 return ErrInvalidLengthPerf 881 } 882 if (iNdEx + skippy) > l { 883 return io.ErrUnexpectedEOF 884 } 885 iNdEx += skippy 886 } 887 } 888 889 if iNdEx > l { 890 return io.ErrUnexpectedEOF 891 } 892 return nil 893 } 894 func skipPerf(dAtA []byte) (n int, err error) { 895 l := len(dAtA) 896 iNdEx := 0 897 depth := 0 898 for iNdEx < l { 899 var wire uint64 900 for shift := uint(0); ; shift += 7 { 901 if shift >= 64 { 902 return 0, ErrIntOverflowPerf 903 } 904 if iNdEx >= l { 905 return 0, io.ErrUnexpectedEOF 906 } 907 b := dAtA[iNdEx] 908 iNdEx++ 909 wire |= (uint64(b) & 0x7F) << shift 910 if b < 0x80 { 911 break 912 } 913 } 914 wireType := int(wire & 0x7) 915 switch wireType { 916 case 0: 917 for shift := uint(0); ; shift += 7 { 918 if shift >= 64 { 919 return 0, ErrIntOverflowPerf 920 } 921 if iNdEx >= l { 922 return 0, io.ErrUnexpectedEOF 923 } 924 iNdEx++ 925 if dAtA[iNdEx-1] < 0x80 { 926 break 927 } 928 } 929 case 1: 930 iNdEx += 8 931 case 2: 932 var length int 933 for shift := uint(0); ; shift += 7 { 934 if shift >= 64 { 935 return 0, ErrIntOverflowPerf 936 } 937 if iNdEx >= l { 938 return 0, io.ErrUnexpectedEOF 939 } 940 b := dAtA[iNdEx] 941 iNdEx++ 942 length |= (int(b) & 0x7F) << shift 943 if b < 0x80 { 944 break 945 } 946 } 947 if length < 0 { 948 return 0, ErrInvalidLengthPerf 949 } 950 iNdEx += length 951 case 3: 952 depth++ 953 case 4: 954 if depth == 0 { 955 return 0, ErrUnexpectedEndOfGroupPerf 956 } 957 depth-- 958 case 5: 959 iNdEx += 4 960 default: 961 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 962 } 963 if iNdEx < 0 { 964 return 0, ErrInvalidLengthPerf 965 } 966 if depth == 0 { 967 return iNdEx, nil 968 } 969 } 970 return 0, io.ErrUnexpectedEOF 971 } 972 973 var ( 974 ErrInvalidLengthPerf = fmt.Errorf("proto: negative length found during unmarshaling") 975 ErrIntOverflowPerf = fmt.Errorf("proto: integer overflow") 976 ErrUnexpectedEndOfGroupPerf = fmt.Errorf("proto: unexpected end of group") 977 )