MCPcopy Create free account
hub / github.com/cortexproject/cortex / Unmarshal

Method Unmarshal

pkg/cortexpb/cortex.pb.go:5278–5431  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

5276 return nil
5277}
5278func (m *StreamWriteRequest) Unmarshal(dAtA []byte) error {
5279 l := len(dAtA)
5280 iNdEx := 0
5281 for iNdEx < l {
5282 preIndex := iNdEx
5283 var wire uint64
5284 for shift := uint(0); ; shift += 7 {
5285 if shift >= 64 {
5286 return ErrIntOverflowCortex
5287 }
5288 if iNdEx >= l {
5289 return io.ErrUnexpectedEOF
5290 }
5291 b := dAtA[iNdEx]
5292 iNdEx++
5293 wire |= uint64(b&0x7F) << shift
5294 if b < 0x80 {
5295 break
5296 }
5297 }
5298 fieldNum := int32(wire >> 3)
5299 wireType := int(wire & 0x7)
5300 if wireType == 4 {
5301 return fmt.Errorf("proto: StreamWriteRequest: wiretype end group for non-group")
5302 }
5303 if fieldNum <= 0 {
5304 return fmt.Errorf("proto: StreamWriteRequest: illegal tag %d (wire type %d)", fieldNum, wire)
5305 }
5306 switch fieldNum {
5307 case 1:
5308 if wireType != 2 {
5309 return fmt.Errorf("proto: wrong wireType = %d for field TenantID", wireType)
5310 }
5311 var stringLen uint64
5312 for shift := uint(0); ; shift += 7 {
5313 if shift >= 64 {
5314 return ErrIntOverflowCortex
5315 }
5316 if iNdEx >= l {
5317 return io.ErrUnexpectedEOF
5318 }
5319 b := dAtA[iNdEx]
5320 iNdEx++
5321 stringLen |= uint64(b&0x7F) << shift
5322 if b < 0x80 {
5323 break
5324 }
5325 }
5326 intStringLen := int(stringLen)
5327 if intStringLen < 0 {
5328 return ErrInvalidLengthCortex
5329 }
5330 postIndex := iNdEx + intStringLen
5331 if postIndex < 0 {
5332 return ErrInvalidLengthCortex
5333 }
5334 if postIndex > l {
5335 return io.ErrUnexpectedEOF

Callers 1

XXX_UnmarshalMethod · 0.95

Calls 2

skipCortexFunction · 0.85
UnmarshalMethod · 0.45

Tested by

no test coverage detected