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

Method Unmarshal

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

Source from the content-addressed store, hash-verified

1931 return fmt.Sprintf("*%v", pv)
1932}
1933func (m *RulesRequest) Unmarshal(dAtA []byte) error {
1934 l := len(dAtA)
1935 iNdEx := 0
1936 for iNdEx < l {
1937 preIndex := iNdEx
1938 var wire uint64
1939 for shift := uint(0); ; shift += 7 {
1940 if shift >= 64 {
1941 return ErrIntOverflowRuler
1942 }
1943 if iNdEx >= l {
1944 return io.ErrUnexpectedEOF
1945 }
1946 b := dAtA[iNdEx]
1947 iNdEx++
1948 wire |= uint64(b&0x7F) << shift
1949 if b < 0x80 {
1950 break
1951 }
1952 }
1953 fieldNum := int32(wire >> 3)
1954 wireType := int(wire & 0x7)
1955 if wireType == 4 {
1956 return fmt.Errorf("proto: RulesRequest: wiretype end group for non-group")
1957 }
1958 if fieldNum <= 0 {
1959 return fmt.Errorf("proto: RulesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
1960 }
1961 switch fieldNum {
1962 case 1:
1963 if wireType != 2 {
1964 return fmt.Errorf("proto: wrong wireType = %d for field RuleNames", wireType)
1965 }
1966 var stringLen uint64
1967 for shift := uint(0); ; shift += 7 {
1968 if shift >= 64 {
1969 return ErrIntOverflowRuler
1970 }
1971 if iNdEx >= l {
1972 return io.ErrUnexpectedEOF
1973 }
1974 b := dAtA[iNdEx]
1975 iNdEx++
1976 stringLen |= uint64(b&0x7F) << shift
1977 if b < 0x80 {
1978 break
1979 }
1980 }
1981 intStringLen := int(stringLen)
1982 if intStringLen < 0 {
1983 return ErrInvalidLengthRuler
1984 }
1985 postIndex := iNdEx + intStringLen
1986 if postIndex < 0 {
1987 return ErrInvalidLengthRuler
1988 }
1989 if postIndex > l {
1990 return io.ErrUnexpectedEOF

Callers 13

XXX_UnmarshalMethod · 0.95
DecodeMethod · 0.45
DecodeMethod · 0.45
CreateRuleGroupMethod · 0.45
TestRuler_rulesFunction · 0.45
TestRuler_rules_limitFunction · 0.45
TestRuler_alertsFunction · 0.45
UnmarshalMethod · 0.45
UnmarshalMethod · 0.45
UnmarshalMethod · 0.45

Calls 1

skipRulerFunction · 0.85

Tested by 5

TestRuler_rulesFunction · 0.36
TestRuler_rules_limitFunction · 0.36
TestRuler_alertsFunction · 0.36