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