github.com/vedadiyan/sqlparser@v1.0.0/pkg/vtrpc/vtrpc_vtproto.pb.go (about) 1 // Code generated by protoc-gen-go-vtproto. DO NOT EDIT. 2 // protoc-gen-go-vtproto version: v0.4.0 3 // source: vtrpc.proto 4 5 package vtrpc 6 7 import ( 8 fmt "fmt" 9 protoimpl "google.golang.org/protobuf/runtime/protoimpl" 10 io "io" 11 bits "math/bits" 12 ) 13 14 const ( 15 // Verify that this generated code is sufficiently up-to-date. 16 _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) 17 // Verify that runtime/protoimpl is sufficiently up-to-date. 18 _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) 19 ) 20 21 func (m *CallerID) MarshalVT() (dAtA []byte, err error) { 22 if m == nil { 23 return nil, nil 24 } 25 size := m.SizeVT() 26 dAtA = make([]byte, size) 27 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 28 if err != nil { 29 return nil, err 30 } 31 return dAtA[:n], nil 32 } 33 34 func (m *CallerID) MarshalToVT(dAtA []byte) (int, error) { 35 size := m.SizeVT() 36 return m.MarshalToSizedBufferVT(dAtA[:size]) 37 } 38 39 func (m *CallerID) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 40 if m == nil { 41 return 0, nil 42 } 43 i := len(dAtA) 44 _ = i 45 var l int 46 _ = l 47 if m.unknownFields != nil { 48 i -= len(m.unknownFields) 49 copy(dAtA[i:], m.unknownFields) 50 } 51 if len(m.Groups) > 0 { 52 for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- { 53 i -= len(m.Groups[iNdEx]) 54 copy(dAtA[i:], m.Groups[iNdEx]) 55 i = encodeVarint(dAtA, i, uint64(len(m.Groups[iNdEx]))) 56 i-- 57 dAtA[i] = 0x22 58 } 59 } 60 if len(m.Subcomponent) > 0 { 61 i -= len(m.Subcomponent) 62 copy(dAtA[i:], m.Subcomponent) 63 i = encodeVarint(dAtA, i, uint64(len(m.Subcomponent))) 64 i-- 65 dAtA[i] = 0x1a 66 } 67 if len(m.Component) > 0 { 68 i -= len(m.Component) 69 copy(dAtA[i:], m.Component) 70 i = encodeVarint(dAtA, i, uint64(len(m.Component))) 71 i-- 72 dAtA[i] = 0x12 73 } 74 if len(m.Principal) > 0 { 75 i -= len(m.Principal) 76 copy(dAtA[i:], m.Principal) 77 i = encodeVarint(dAtA, i, uint64(len(m.Principal))) 78 i-- 79 dAtA[i] = 0xa 80 } 81 return len(dAtA) - i, nil 82 } 83 84 func (m *RPCError) MarshalVT() (dAtA []byte, err error) { 85 if m == nil { 86 return nil, nil 87 } 88 size := m.SizeVT() 89 dAtA = make([]byte, size) 90 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 91 if err != nil { 92 return nil, err 93 } 94 return dAtA[:n], nil 95 } 96 97 func (m *RPCError) MarshalToVT(dAtA []byte) (int, error) { 98 size := m.SizeVT() 99 return m.MarshalToSizedBufferVT(dAtA[:size]) 100 } 101 102 func (m *RPCError) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 103 if m == nil { 104 return 0, nil 105 } 106 i := len(dAtA) 107 _ = i 108 var l int 109 _ = l 110 if m.unknownFields != nil { 111 i -= len(m.unknownFields) 112 copy(dAtA[i:], m.unknownFields) 113 } 114 if m.Code != 0 { 115 i = encodeVarint(dAtA, i, uint64(m.Code)) 116 i-- 117 dAtA[i] = 0x18 118 } 119 if len(m.Message) > 0 { 120 i -= len(m.Message) 121 copy(dAtA[i:], m.Message) 122 i = encodeVarint(dAtA, i, uint64(len(m.Message))) 123 i-- 124 dAtA[i] = 0x12 125 } 126 return len(dAtA) - i, nil 127 } 128 129 func encodeVarint(dAtA []byte, offset int, v uint64) int { 130 offset -= sov(v) 131 base := offset 132 for v >= 1<<7 { 133 dAtA[offset] = uint8(v&0x7f | 0x80) 134 v >>= 7 135 offset++ 136 } 137 dAtA[offset] = uint8(v) 138 return base 139 } 140 func (m *CallerID) SizeVT() (n int) { 141 if m == nil { 142 return 0 143 } 144 var l int 145 _ = l 146 l = len(m.Principal) 147 if l > 0 { 148 n += 1 + l + sov(uint64(l)) 149 } 150 l = len(m.Component) 151 if l > 0 { 152 n += 1 + l + sov(uint64(l)) 153 } 154 l = len(m.Subcomponent) 155 if l > 0 { 156 n += 1 + l + sov(uint64(l)) 157 } 158 if len(m.Groups) > 0 { 159 for _, s := range m.Groups { 160 l = len(s) 161 n += 1 + l + sov(uint64(l)) 162 } 163 } 164 n += len(m.unknownFields) 165 return n 166 } 167 168 func (m *RPCError) SizeVT() (n int) { 169 if m == nil { 170 return 0 171 } 172 var l int 173 _ = l 174 l = len(m.Message) 175 if l > 0 { 176 n += 1 + l + sov(uint64(l)) 177 } 178 if m.Code != 0 { 179 n += 1 + sov(uint64(m.Code)) 180 } 181 n += len(m.unknownFields) 182 return n 183 } 184 185 func sov(x uint64) (n int) { 186 return (bits.Len64(x|1) + 6) / 7 187 } 188 func soz(x uint64) (n int) { 189 return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 190 } 191 func (m *CallerID) UnmarshalVT(dAtA []byte) error { 192 l := len(dAtA) 193 iNdEx := 0 194 for iNdEx < l { 195 preIndex := iNdEx 196 var wire uint64 197 for shift := uint(0); ; shift += 7 { 198 if shift >= 64 { 199 return ErrIntOverflow 200 } 201 if iNdEx >= l { 202 return io.ErrUnexpectedEOF 203 } 204 b := dAtA[iNdEx] 205 iNdEx++ 206 wire |= uint64(b&0x7F) << shift 207 if b < 0x80 { 208 break 209 } 210 } 211 fieldNum := int32(wire >> 3) 212 wireType := int(wire & 0x7) 213 if wireType == 4 { 214 return fmt.Errorf("proto: CallerID: wiretype end group for non-group") 215 } 216 if fieldNum <= 0 { 217 return fmt.Errorf("proto: CallerID: illegal tag %d (wire type %d)", fieldNum, wire) 218 } 219 switch fieldNum { 220 case 1: 221 if wireType != 2 { 222 return fmt.Errorf("proto: wrong wireType = %d for field Principal", wireType) 223 } 224 var stringLen uint64 225 for shift := uint(0); ; shift += 7 { 226 if shift >= 64 { 227 return ErrIntOverflow 228 } 229 if iNdEx >= l { 230 return io.ErrUnexpectedEOF 231 } 232 b := dAtA[iNdEx] 233 iNdEx++ 234 stringLen |= uint64(b&0x7F) << shift 235 if b < 0x80 { 236 break 237 } 238 } 239 intStringLen := int(stringLen) 240 if intStringLen < 0 { 241 return ErrInvalidLength 242 } 243 postIndex := iNdEx + intStringLen 244 if postIndex < 0 { 245 return ErrInvalidLength 246 } 247 if postIndex > l { 248 return io.ErrUnexpectedEOF 249 } 250 m.Principal = string(dAtA[iNdEx:postIndex]) 251 iNdEx = postIndex 252 case 2: 253 if wireType != 2 { 254 return fmt.Errorf("proto: wrong wireType = %d for field Component", wireType) 255 } 256 var stringLen uint64 257 for shift := uint(0); ; shift += 7 { 258 if shift >= 64 { 259 return ErrIntOverflow 260 } 261 if iNdEx >= l { 262 return io.ErrUnexpectedEOF 263 } 264 b := dAtA[iNdEx] 265 iNdEx++ 266 stringLen |= uint64(b&0x7F) << shift 267 if b < 0x80 { 268 break 269 } 270 } 271 intStringLen := int(stringLen) 272 if intStringLen < 0 { 273 return ErrInvalidLength 274 } 275 postIndex := iNdEx + intStringLen 276 if postIndex < 0 { 277 return ErrInvalidLength 278 } 279 if postIndex > l { 280 return io.ErrUnexpectedEOF 281 } 282 m.Component = string(dAtA[iNdEx:postIndex]) 283 iNdEx = postIndex 284 case 3: 285 if wireType != 2 { 286 return fmt.Errorf("proto: wrong wireType = %d for field Subcomponent", wireType) 287 } 288 var stringLen uint64 289 for shift := uint(0); ; shift += 7 { 290 if shift >= 64 { 291 return ErrIntOverflow 292 } 293 if iNdEx >= l { 294 return io.ErrUnexpectedEOF 295 } 296 b := dAtA[iNdEx] 297 iNdEx++ 298 stringLen |= uint64(b&0x7F) << shift 299 if b < 0x80 { 300 break 301 } 302 } 303 intStringLen := int(stringLen) 304 if intStringLen < 0 { 305 return ErrInvalidLength 306 } 307 postIndex := iNdEx + intStringLen 308 if postIndex < 0 { 309 return ErrInvalidLength 310 } 311 if postIndex > l { 312 return io.ErrUnexpectedEOF 313 } 314 m.Subcomponent = string(dAtA[iNdEx:postIndex]) 315 iNdEx = postIndex 316 case 4: 317 if wireType != 2 { 318 return fmt.Errorf("proto: wrong wireType = %d for field Groups", wireType) 319 } 320 var stringLen uint64 321 for shift := uint(0); ; shift += 7 { 322 if shift >= 64 { 323 return ErrIntOverflow 324 } 325 if iNdEx >= l { 326 return io.ErrUnexpectedEOF 327 } 328 b := dAtA[iNdEx] 329 iNdEx++ 330 stringLen |= uint64(b&0x7F) << shift 331 if b < 0x80 { 332 break 333 } 334 } 335 intStringLen := int(stringLen) 336 if intStringLen < 0 { 337 return ErrInvalidLength 338 } 339 postIndex := iNdEx + intStringLen 340 if postIndex < 0 { 341 return ErrInvalidLength 342 } 343 if postIndex > l { 344 return io.ErrUnexpectedEOF 345 } 346 m.Groups = append(m.Groups, string(dAtA[iNdEx:postIndex])) 347 iNdEx = postIndex 348 default: 349 iNdEx = preIndex 350 skippy, err := skip(dAtA[iNdEx:]) 351 if err != nil { 352 return err 353 } 354 if (skippy < 0) || (iNdEx+skippy) < 0 { 355 return ErrInvalidLength 356 } 357 if (iNdEx + skippy) > l { 358 return io.ErrUnexpectedEOF 359 } 360 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 361 iNdEx += skippy 362 } 363 } 364 365 if iNdEx > l { 366 return io.ErrUnexpectedEOF 367 } 368 return nil 369 } 370 func (m *RPCError) UnmarshalVT(dAtA []byte) error { 371 l := len(dAtA) 372 iNdEx := 0 373 for iNdEx < l { 374 preIndex := iNdEx 375 var wire uint64 376 for shift := uint(0); ; shift += 7 { 377 if shift >= 64 { 378 return ErrIntOverflow 379 } 380 if iNdEx >= l { 381 return io.ErrUnexpectedEOF 382 } 383 b := dAtA[iNdEx] 384 iNdEx++ 385 wire |= uint64(b&0x7F) << shift 386 if b < 0x80 { 387 break 388 } 389 } 390 fieldNum := int32(wire >> 3) 391 wireType := int(wire & 0x7) 392 if wireType == 4 { 393 return fmt.Errorf("proto: RPCError: wiretype end group for non-group") 394 } 395 if fieldNum <= 0 { 396 return fmt.Errorf("proto: RPCError: illegal tag %d (wire type %d)", fieldNum, wire) 397 } 398 switch fieldNum { 399 case 2: 400 if wireType != 2 { 401 return fmt.Errorf("proto: wrong wireType = %d for field Message", wireType) 402 } 403 var stringLen uint64 404 for shift := uint(0); ; shift += 7 { 405 if shift >= 64 { 406 return ErrIntOverflow 407 } 408 if iNdEx >= l { 409 return io.ErrUnexpectedEOF 410 } 411 b := dAtA[iNdEx] 412 iNdEx++ 413 stringLen |= uint64(b&0x7F) << shift 414 if b < 0x80 { 415 break 416 } 417 } 418 intStringLen := int(stringLen) 419 if intStringLen < 0 { 420 return ErrInvalidLength 421 } 422 postIndex := iNdEx + intStringLen 423 if postIndex < 0 { 424 return ErrInvalidLength 425 } 426 if postIndex > l { 427 return io.ErrUnexpectedEOF 428 } 429 m.Message = string(dAtA[iNdEx:postIndex]) 430 iNdEx = postIndex 431 case 3: 432 if wireType != 0 { 433 return fmt.Errorf("proto: wrong wireType = %d for field Code", wireType) 434 } 435 m.Code = 0 436 for shift := uint(0); ; shift += 7 { 437 if shift >= 64 { 438 return ErrIntOverflow 439 } 440 if iNdEx >= l { 441 return io.ErrUnexpectedEOF 442 } 443 b := dAtA[iNdEx] 444 iNdEx++ 445 m.Code |= Code(b&0x7F) << shift 446 if b < 0x80 { 447 break 448 } 449 } 450 default: 451 iNdEx = preIndex 452 skippy, err := skip(dAtA[iNdEx:]) 453 if err != nil { 454 return err 455 } 456 if (skippy < 0) || (iNdEx+skippy) < 0 { 457 return ErrInvalidLength 458 } 459 if (iNdEx + skippy) > l { 460 return io.ErrUnexpectedEOF 461 } 462 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 463 iNdEx += skippy 464 } 465 } 466 467 if iNdEx > l { 468 return io.ErrUnexpectedEOF 469 } 470 return nil 471 } 472 473 func skip(dAtA []byte) (n int, err error) { 474 l := len(dAtA) 475 iNdEx := 0 476 depth := 0 477 for iNdEx < l { 478 var wire uint64 479 for shift := uint(0); ; shift += 7 { 480 if shift >= 64 { 481 return 0, ErrIntOverflow 482 } 483 if iNdEx >= l { 484 return 0, io.ErrUnexpectedEOF 485 } 486 b := dAtA[iNdEx] 487 iNdEx++ 488 wire |= (uint64(b) & 0x7F) << shift 489 if b < 0x80 { 490 break 491 } 492 } 493 wireType := int(wire & 0x7) 494 switch wireType { 495 case 0: 496 for shift := uint(0); ; shift += 7 { 497 if shift >= 64 { 498 return 0, ErrIntOverflow 499 } 500 if iNdEx >= l { 501 return 0, io.ErrUnexpectedEOF 502 } 503 iNdEx++ 504 if dAtA[iNdEx-1] < 0x80 { 505 break 506 } 507 } 508 case 1: 509 iNdEx += 8 510 case 2: 511 var length int 512 for shift := uint(0); ; shift += 7 { 513 if shift >= 64 { 514 return 0, ErrIntOverflow 515 } 516 if iNdEx >= l { 517 return 0, io.ErrUnexpectedEOF 518 } 519 b := dAtA[iNdEx] 520 iNdEx++ 521 length |= (int(b) & 0x7F) << shift 522 if b < 0x80 { 523 break 524 } 525 } 526 if length < 0 { 527 return 0, ErrInvalidLength 528 } 529 iNdEx += length 530 case 3: 531 depth++ 532 case 4: 533 if depth == 0 { 534 return 0, ErrUnexpectedEndOfGroup 535 } 536 depth-- 537 case 5: 538 iNdEx += 4 539 default: 540 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 541 } 542 if iNdEx < 0 { 543 return 0, ErrInvalidLength 544 } 545 if depth == 0 { 546 return iNdEx, nil 547 } 548 } 549 return 0, io.ErrUnexpectedEOF 550 } 551 552 var ( 553 ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") 554 ErrIntOverflow = fmt.Errorf("proto: integer overflow") 555 ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") 556 )