github.com/team-ide/go-dialect@v1.9.20/vitess/vttime/vttime_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: 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  	if m.unknownFields != nil {
   131  		n += len(m.unknownFields)
   132  	}
   133  	return n
   134  }
   135  
   136  func (m *Duration) SizeVT() (n int) {
   137  	if m == nil {
   138  		return 0
   139  	}
   140  	var l int
   141  	_ = l
   142  	if m.Seconds != 0 {
   143  		n += 1 + sov(uint64(m.Seconds))
   144  	}
   145  	if m.Nanos != 0 {
   146  		n += 1 + sov(uint64(m.Nanos))
   147  	}
   148  	if m.unknownFields != nil {
   149  		n += len(m.unknownFields)
   150  	}
   151  	return n
   152  }
   153  
   154  func sov(x uint64) (n int) {
   155  	return (bits.Len64(x|1) + 6) / 7
   156  }
   157  func soz(x uint64) (n int) {
   158  	return sov(uint64((x << 1) ^ uint64((int64(x) >> 63))))
   159  }
   160  func (m *Time) UnmarshalVT(dAtA []byte) error {
   161  	l := len(dAtA)
   162  	iNdEx := 0
   163  	for iNdEx < l {
   164  		preIndex := iNdEx
   165  		var wire uint64
   166  		for shift := uint(0); ; shift += 7 {
   167  			if shift >= 64 {
   168  				return ErrIntOverflow
   169  			}
   170  			if iNdEx >= l {
   171  				return io.ErrUnexpectedEOF
   172  			}
   173  			b := dAtA[iNdEx]
   174  			iNdEx++
   175  			wire |= uint64(b&0x7F) << shift
   176  			if b < 0x80 {
   177  				break
   178  			}
   179  		}
   180  		fieldNum := int32(wire >> 3)
   181  		wireType := int(wire & 0x7)
   182  		if wireType == 4 {
   183  			return fmt.Errorf("proto: Time: wiretype end group for non-group")
   184  		}
   185  		if fieldNum <= 0 {
   186  			return fmt.Errorf("proto: Time: illegal tag %d (wire type %d)", fieldNum, wire)
   187  		}
   188  		switch fieldNum {
   189  		case 1:
   190  			if wireType != 0 {
   191  				return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType)
   192  			}
   193  			m.Seconds = 0
   194  			for shift := uint(0); ; shift += 7 {
   195  				if shift >= 64 {
   196  					return ErrIntOverflow
   197  				}
   198  				if iNdEx >= l {
   199  					return io.ErrUnexpectedEOF
   200  				}
   201  				b := dAtA[iNdEx]
   202  				iNdEx++
   203  				m.Seconds |= int64(b&0x7F) << shift
   204  				if b < 0x80 {
   205  					break
   206  				}
   207  			}
   208  		case 2:
   209  			if wireType != 0 {
   210  				return fmt.Errorf("proto: wrong wireType = %d for field Nanoseconds", wireType)
   211  			}
   212  			m.Nanoseconds = 0
   213  			for shift := uint(0); ; shift += 7 {
   214  				if shift >= 64 {
   215  					return ErrIntOverflow
   216  				}
   217  				if iNdEx >= l {
   218  					return io.ErrUnexpectedEOF
   219  				}
   220  				b := dAtA[iNdEx]
   221  				iNdEx++
   222  				m.Nanoseconds |= int32(b&0x7F) << shift
   223  				if b < 0x80 {
   224  					break
   225  				}
   226  			}
   227  		default:
   228  			iNdEx = preIndex
   229  			skippy, err := skip(dAtA[iNdEx:])
   230  			if err != nil {
   231  				return err
   232  			}
   233  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   234  				return ErrInvalidLength
   235  			}
   236  			if (iNdEx + skippy) > l {
   237  				return io.ErrUnexpectedEOF
   238  			}
   239  			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
   240  			iNdEx += skippy
   241  		}
   242  	}
   243  
   244  	if iNdEx > l {
   245  		return io.ErrUnexpectedEOF
   246  	}
   247  	return nil
   248  }
   249  func (m *Duration) UnmarshalVT(dAtA []byte) error {
   250  	l := len(dAtA)
   251  	iNdEx := 0
   252  	for iNdEx < l {
   253  		preIndex := iNdEx
   254  		var wire uint64
   255  		for shift := uint(0); ; shift += 7 {
   256  			if shift >= 64 {
   257  				return ErrIntOverflow
   258  			}
   259  			if iNdEx >= l {
   260  				return io.ErrUnexpectedEOF
   261  			}
   262  			b := dAtA[iNdEx]
   263  			iNdEx++
   264  			wire |= uint64(b&0x7F) << shift
   265  			if b < 0x80 {
   266  				break
   267  			}
   268  		}
   269  		fieldNum := int32(wire >> 3)
   270  		wireType := int(wire & 0x7)
   271  		if wireType == 4 {
   272  			return fmt.Errorf("proto: Duration: wiretype end group for non-group")
   273  		}
   274  		if fieldNum <= 0 {
   275  			return fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire)
   276  		}
   277  		switch fieldNum {
   278  		case 1:
   279  			if wireType != 0 {
   280  				return fmt.Errorf("proto: wrong wireType = %d for field Seconds", wireType)
   281  			}
   282  			m.Seconds = 0
   283  			for shift := uint(0); ; shift += 7 {
   284  				if shift >= 64 {
   285  					return ErrIntOverflow
   286  				}
   287  				if iNdEx >= l {
   288  					return io.ErrUnexpectedEOF
   289  				}
   290  				b := dAtA[iNdEx]
   291  				iNdEx++
   292  				m.Seconds |= int64(b&0x7F) << shift
   293  				if b < 0x80 {
   294  					break
   295  				}
   296  			}
   297  		case 2:
   298  			if wireType != 0 {
   299  				return fmt.Errorf("proto: wrong wireType = %d for field Nanos", wireType)
   300  			}
   301  			m.Nanos = 0
   302  			for shift := uint(0); ; shift += 7 {
   303  				if shift >= 64 {
   304  					return ErrIntOverflow
   305  				}
   306  				if iNdEx >= l {
   307  					return io.ErrUnexpectedEOF
   308  				}
   309  				b := dAtA[iNdEx]
   310  				iNdEx++
   311  				m.Nanos |= int32(b&0x7F) << shift
   312  				if b < 0x80 {
   313  					break
   314  				}
   315  			}
   316  		default:
   317  			iNdEx = preIndex
   318  			skippy, err := skip(dAtA[iNdEx:])
   319  			if err != nil {
   320  				return err
   321  			}
   322  			if (skippy < 0) || (iNdEx+skippy) < 0 {
   323  				return ErrInvalidLength
   324  			}
   325  			if (iNdEx + skippy) > l {
   326  				return io.ErrUnexpectedEOF
   327  			}
   328  			m.unknownFields = append(m.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
   329  			iNdEx += skippy
   330  		}
   331  	}
   332  
   333  	if iNdEx > l {
   334  		return io.ErrUnexpectedEOF
   335  	}
   336  	return nil
   337  }
   338  func skip(dAtA []byte) (n int, err error) {
   339  	l := len(dAtA)
   340  	iNdEx := 0
   341  	depth := 0
   342  	for iNdEx < l {
   343  		var wire uint64
   344  		for shift := uint(0); ; shift += 7 {
   345  			if shift >= 64 {
   346  				return 0, ErrIntOverflow
   347  			}
   348  			if iNdEx >= l {
   349  				return 0, io.ErrUnexpectedEOF
   350  			}
   351  			b := dAtA[iNdEx]
   352  			iNdEx++
   353  			wire |= (uint64(b) & 0x7F) << shift
   354  			if b < 0x80 {
   355  				break
   356  			}
   357  		}
   358  		wireType := int(wire & 0x7)
   359  		switch wireType {
   360  		case 0:
   361  			for shift := uint(0); ; shift += 7 {
   362  				if shift >= 64 {
   363  					return 0, ErrIntOverflow
   364  				}
   365  				if iNdEx >= l {
   366  					return 0, io.ErrUnexpectedEOF
   367  				}
   368  				iNdEx++
   369  				if dAtA[iNdEx-1] < 0x80 {
   370  					break
   371  				}
   372  			}
   373  		case 1:
   374  			iNdEx += 8
   375  		case 2:
   376  			var length int
   377  			for shift := uint(0); ; shift += 7 {
   378  				if shift >= 64 {
   379  					return 0, ErrIntOverflow
   380  				}
   381  				if iNdEx >= l {
   382  					return 0, io.ErrUnexpectedEOF
   383  				}
   384  				b := dAtA[iNdEx]
   385  				iNdEx++
   386  				length |= (int(b) & 0x7F) << shift
   387  				if b < 0x80 {
   388  					break
   389  				}
   390  			}
   391  			if length < 0 {
   392  				return 0, ErrInvalidLength
   393  			}
   394  			iNdEx += length
   395  		case 3:
   396  			depth++
   397  		case 4:
   398  			if depth == 0 {
   399  				return 0, ErrUnexpectedEndOfGroup
   400  			}
   401  			depth--
   402  		case 5:
   403  			iNdEx += 4
   404  		default:
   405  			return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
   406  		}
   407  		if iNdEx < 0 {
   408  			return 0, ErrInvalidLength
   409  		}
   410  		if depth == 0 {
   411  			return iNdEx, nil
   412  		}
   413  	}
   414  	return 0, io.ErrUnexpectedEOF
   415  }
   416  
   417  var (
   418  	ErrInvalidLength        = fmt.Errorf("proto: negative length found during unmarshaling")
   419  	ErrIntOverflow          = fmt.Errorf("proto: integer overflow")
   420  	ErrUnexpectedEndOfGroup = fmt.Errorf("proto: unexpected end of group")
   421  )