github.com/vedadiyan/sqlparser@v1.0.0/pkg/vttime/vttime_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: vttime.proto 4 5 package vttime 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 *Time) 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 *Time) MarshalToVT(dAtA []byte) (int, error) { 35 size := m.SizeVT() 36 return m.MarshalToSizedBufferVT(dAtA[:size]) 37 } 38 39 func (m *Time) 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 m.Nanoseconds != 0 { 52 i = encodeVarint(dAtA, i, uint64(m.Nanoseconds)) 53 i-- 54 dAtA[i] = 0x10 55 } 56 if m.Seconds != 0 { 57 i = encodeVarint(dAtA, i, uint64(m.Seconds)) 58 i-- 59 dAtA[i] = 0x8 60 } 61 return len(dAtA) - i, nil 62 } 63 64 func (m *Duration) MarshalVT() (dAtA []byte, err error) { 65 if m == nil { 66 return nil, nil 67 } 68 size := m.SizeVT() 69 dAtA = make([]byte, size) 70 n, err := m.MarshalToSizedBufferVT(dAtA[:size]) 71 if err != nil { 72 return nil, err 73 } 74 return dAtA[:n], nil 75 } 76 77 func (m *Duration) MarshalToVT(dAtA []byte) (int, error) { 78 size := m.SizeVT() 79 return m.MarshalToSizedBufferVT(dAtA[:size]) 80 } 81 82 func (m *Duration) MarshalToSizedBufferVT(dAtA []byte) (int, error) { 83 if m == nil { 84 return 0, nil 85 } 86 i := len(dAtA) 87 _ = i 88 var l int 89 _ = l 90 if m.unknownFields != nil { 91 i -= len(m.unknownFields) 92 copy(dAtA[i:], m.unknownFields) 93 } 94 if m.Nanos != 0 { 95 i = encodeVarint(dAtA, i, uint64(m.Nanos)) 96 i-- 97 dAtA[i] = 0x10 98 } 99 if m.Seconds != 0 { 100 i = encodeVarint(dAtA, i, uint64(m.Seconds)) 101 i-- 102 dAtA[i] = 0x8 103 } 104 return len(dAtA) - i, nil 105 } 106 107 func encodeVarint(dAtA []byte, offset int, v uint64) int { 108 offset -= sov(v) 109 base := offset 110 for v >= 1<<7 { 111 dAtA[offset] = uint8(v&0x7f | 0x80) 112 v >>= 7 113 offset++ 114 } 115 dAtA[offset] = uint8(v) 116 return base 117 } 118 func (m *Time) SizeVT() (n int) { 119 if m == nil { 120 return 0 121 } 122 var l int 123 _ = l 124 if m.Seconds != 0 { 125 n += 1 + sov(uint64(m.Seconds)) 126 } 127 if m.Nanoseconds != 0 { 128 n += 1 + sov(uint64(m.Nanoseconds)) 129 } 130 n += len(m.unknownFields) 131 return n 132 } 133 134 func (m *Duration) SizeVT() (n int) { 135 if m == nil { 136 return 0 137 } 138 var l int 139 _ = l 140 if m.Seconds != 0 { 141 n += 1 + sov(uint64(m.Seconds)) 142 } 143 if m.Nanos != 0 { 144 n += 1 + sov(uint64(m.Nanos)) 145 } 146 n += len(m.unknownFields) 147 return n 148 } 149 150 func sov(x uint64) (n int) { 151 return (bits.Len64(x|1) + 6) / 7 152 } 153 func soz(x uint64) (n int) { 154 return sov(uint64((x << 1) ^ uint64((int64(x) >> 63)))) 155 } 156 func (m *Time) UnmarshalVT(dAtA []byte) error { 157 l := len(dAtA) 158 iNdEx := 0 159 for iNdEx < l { 160 preIndex := iNdEx 161 var wire uint64 162 for shift := uint(0); ; shift += 7 { 163 if shift >= 64 { 164 return ErrIntOverflow 165 } 166 if iNdEx >= l { 167 return io.ErrUnexpectedEOF 168 } 169 b := dAtA[iNdEx] 170 iNdEx++ 171 wire |= uint64(b&0x7F) << shift 172 if b < 0x80 { 173 break 174 } 175 } 176 fieldNum := int32(wire >> 3) 177 wireType := int(wire & 0x7) 178 if wireType == 4 { 179 return fmt.Errorf("proto: Time: wiretype end group for non-group") 180 } 181 if fieldNum <= 0 { 182 return fmt.Errorf("proto: Time: illegal tag %d (wire type %d)", fieldNum, wire) 183 } 184 switch fieldNum { 185 case 1: 186 if wireType != 0 { 187 return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) 188 } 189 m.Seconds = 0 190 for shift := uint(0); ; shift += 7 { 191 if shift >= 64 { 192 return ErrIntOverflow 193 } 194 if iNdEx >= l { 195 return io.ErrUnexpectedEOF 196 } 197 b := dAtA[iNdEx] 198 iNdEx++ 199 m.Seconds |= int64(b&0x7F) << shift 200 if b < 0x80 { 201 break 202 } 203 } 204 case 2: 205 if wireType != 0 { 206 return fmt.Errorf("proto: wrong wireType = %d for field Nanoseconds", wireType) 207 } 208 m.Nanoseconds = 0 209 for shift := uint(0); ; shift += 7 { 210 if shift >= 64 { 211 return ErrIntOverflow 212 } 213 if iNdEx >= l { 214 return io.ErrUnexpectedEOF 215 } 216 b := dAtA[iNdEx] 217 iNdEx++ 218 m.Nanoseconds |= int32(b&0x7F) << shift 219 if b < 0x80 { 220 break 221 } 222 } 223 default: 224 iNdEx = preIndex 225 skippy, err := skip(dAtA[iNdEx:]) 226 if err != nil { 227 return err 228 } 229 if (skippy < 0) || (iNdEx+skippy) < 0 { 230 return ErrInvalidLength 231 } 232 if (iNdEx + skippy) > l { 233 return io.ErrUnexpectedEOF 234 } 235 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 236 iNdEx += skippy 237 } 238 } 239 240 if iNdEx > l { 241 return io.ErrUnexpectedEOF 242 } 243 return nil 244 } 245 func (m *Duration) UnmarshalVT(dAtA []byte) error { 246 l := len(dAtA) 247 iNdEx := 0 248 for iNdEx < l { 249 preIndex := iNdEx 250 var wire uint64 251 for shift := uint(0); ; shift += 7 { 252 if shift >= 64 { 253 return ErrIntOverflow 254 } 255 if iNdEx >= l { 256 return io.ErrUnexpectedEOF 257 } 258 b := dAtA[iNdEx] 259 iNdEx++ 260 wire |= uint64(b&0x7F) << shift 261 if b < 0x80 { 262 break 263 } 264 } 265 fieldNum := int32(wire >> 3) 266 wireType := int(wire & 0x7) 267 if wireType == 4 { 268 return fmt.Errorf("proto: Duration: wiretype end group for non-group") 269 } 270 if fieldNum <= 0 { 271 return fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire) 272 } 273 switch fieldNum { 274 case 1: 275 if wireType != 0 { 276 return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType) 277 } 278 m.Seconds = 0 279 for shift := uint(0); ; shift += 7 { 280 if shift >= 64 { 281 return ErrIntOverflow 282 } 283 if iNdEx >= l { 284 return io.ErrUnexpectedEOF 285 } 286 b := dAtA[iNdEx] 287 iNdEx++ 288 m.Seconds |= int64(b&0x7F) << shift 289 if b < 0x80 { 290 break 291 } 292 } 293 case 2: 294 if wireType != 0 { 295 return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType) 296 } 297 m.Nanos = 0 298 for shift := uint(0); ; shift += 7 { 299 if shift >= 64 { 300 return ErrIntOverflow 301 } 302 if iNdEx >= l { 303 return io.ErrUnexpectedEOF 304 } 305 b := dAtA[iNdEx] 306 iNdEx++ 307 m.Nanos |= int32(b&0x7F) << shift 308 if b < 0x80 { 309 break 310 } 311 } 312 default: 313 iNdEx = preIndex 314 skippy, err := skip(dAtA[iNdEx:]) 315 if err != nil { 316 return err 317 } 318 if (skippy < 0) || (iNdEx+skippy) < 0 { 319 return ErrInvalidLength 320 } 321 if (iNdEx + skippy) > l { 322 return io.ErrUnexpectedEOF 323 } 324 m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) 325 iNdEx += skippy 326 } 327 } 328 329 if iNdEx > l { 330 return io.ErrUnexpectedEOF 331 } 332 return nil 333 } 334 335 func skip(dAtA []byte) (n int, err error) { 336 l := len(dAtA) 337 iNdEx := 0 338 depth := 0 339 for iNdEx < l { 340 var wire uint64 341 for shift := uint(0); ; shift += 7 { 342 if shift >= 64 { 343 return 0, ErrIntOverflow 344 } 345 if iNdEx >= l { 346 return 0, io.ErrUnexpectedEOF 347 } 348 b := dAtA[iNdEx] 349 iNdEx++ 350 wire |= (uint64(b) & 0x7F) << shift 351 if b < 0x80 { 352 break 353 } 354 } 355 wireType := int(wire & 0x7) 356 switch wireType { 357 case 0: 358 for shift := uint(0); ; shift += 7 { 359 if shift >= 64 { 360 return 0, ErrIntOverflow 361 } 362 if iNdEx >= l { 363 return 0, io.ErrUnexpectedEOF 364 } 365 iNdEx++ 366 if dAtA[iNdEx-1] < 0x80 { 367 break 368 } 369 } 370 case 1: 371 iNdEx += 8 372 case 2: 373 var length int 374 for shift := uint(0); ; shift += 7 { 375 if shift >= 64 { 376 return 0, ErrIntOverflow 377 } 378 if iNdEx >= l { 379 return 0, io.ErrUnexpectedEOF 380 } 381 b := dAtA[iNdEx] 382 iNdEx++ 383 length |= (int(b) & 0x7F) << shift 384 if b < 0x80 { 385 break 386 } 387 } 388 if length < 0 { 389 return 0, ErrInvalidLength 390 } 391 iNdEx += length 392 case 3: 393 depth++ 394 case 4: 395 if depth == 0 { 396 return 0, ErrUnexpectedEndOfGroup 397 } 398 depth-- 399 case 5: 400 iNdEx += 4 401 default: 402 return 0, fmt.Errorf("proto: illegal wireType %d", wireType) 403 } 404 if iNdEx < 0 { 405 return 0, ErrInvalidLength 406 } 407 if depth == 0 { 408 return iNdEx, nil 409 } 410 } 411 return 0, io.ErrUnexpectedEOF 412 } 413 414 var ( 415 ErrInvalidLength = fmt.Errorf("proto: negative length found during unmarshaling") 416 ErrIntOverflow = fmt.Errorf("proto: integer overflow") 417 ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group") 418 )