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

Method Unmarshal

pkg/ruler/ruler.pb.go:2999–3360  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

2997 return nil
2998}
2999func (m *AlertStateDesc) Unmarshal(dAtA []byte) error {
3000 l := len(dAtA)
3001 iNdEx := 0
3002 for iNdEx < l {
3003 preIndex := iNdEx
3004 var wire uint64
3005 for shift := uint(0); ; shift += 7 {
3006 if shift >= 64 {
3007 return ErrIntOverflowRuler
3008 }
3009 if iNdEx >= l {
3010 return io.ErrUnexpectedEOF
3011 }
3012 b := dAtA[iNdEx]
3013 iNdEx++
3014 wire |= uint64(b&0x7F) << shift
3015 if b < 0x80 {
3016 break
3017 }
3018 }
3019 fieldNum := int32(wire >> 3)
3020 wireType := int(wire & 0x7)
3021 if wireType == 4 {
3022 return fmt.Errorf("proto: AlertStateDesc: wiretype end group for non-group")
3023 }
3024 if fieldNum <= 0 {
3025 return fmt.Errorf("proto: AlertStateDesc: illegal tag %d (wire type %d)", fieldNum, wire)
3026 }
3027 switch fieldNum {
3028 case 1:
3029 if wireType != 2 {
3030 return fmt.Errorf("proto: wrong wireType = %d for field State", wireType)
3031 }
3032 var stringLen uint64
3033 for shift := uint(0); ; shift += 7 {
3034 if shift >= 64 {
3035 return ErrIntOverflowRuler
3036 }
3037 if iNdEx >= l {
3038 return io.ErrUnexpectedEOF
3039 }
3040 b := dAtA[iNdEx]
3041 iNdEx++
3042 stringLen |= uint64(b&0x7F) << shift
3043 if b < 0x80 {
3044 break
3045 }
3046 }
3047 intStringLen := int(stringLen)
3048 if intStringLen < 0 {
3049 return ErrInvalidLengthRuler
3050 }
3051 postIndex := iNdEx + intStringLen
3052 if postIndex < 0 {
3053 return ErrInvalidLengthRuler
3054 }
3055 if postIndex > l {
3056 return io.ErrUnexpectedEOF

Callers 1

XXX_UnmarshalMethod · 0.95

Calls 2

skipRulerFunction · 0.85
UnmarshalMethod · 0.45

Tested by

no test coverage detected