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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

1156}
1157
1158func (m *RulesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1159 i := len(dAtA)
1160 _ = i
1161 var l int
1162 _ = l
1163 if len(m.NextToken) > 0 {
1164 i -= len(m.NextToken)
1165 copy(dAtA[i:], m.NextToken)
1166 i = encodeVarintRuler(dAtA, i, uint64(len(m.NextToken)))
1167 i--
1168 dAtA[i] = 0x52
1169 }
1170 if m.MaxRuleGroups != 0 {
1171 i = encodeVarintRuler(dAtA, i, uint64(m.MaxRuleGroups))
1172 i--
1173 dAtA[i] = 0x48
1174 }
1175 if m.ExcludeAlerts {
1176 i--
1177 if m.ExcludeAlerts {
1178 dAtA[i] = 1
1179 } else {
1180 dAtA[i] = 0
1181 }
1182 i--
1183 dAtA[i] = 0x40
1184 }
1185 if len(m.Matchers) > 0 {
1186 for iNdEx := len(m.Matchers) - 1; iNdEx >= 0; iNdEx-- {
1187 i -= len(m.Matchers[iNdEx])
1188 copy(dAtA[i:], m.Matchers[iNdEx])
1189 i = encodeVarintRuler(dAtA, i, uint64(len(m.Matchers[iNdEx])))
1190 i--
1191 dAtA[i] = 0x3a
1192 }
1193 }
1194 if len(m.Health) > 0 {
1195 i -= len(m.Health)
1196 copy(dAtA[i:], m.Health)
1197 i = encodeVarintRuler(dAtA, i, uint64(len(m.Health)))
1198 i--
1199 dAtA[i] = 0x32
1200 }
1201 if len(m.State) > 0 {
1202 i -= len(m.State)
1203 copy(dAtA[i:], m.State)
1204 i = encodeVarintRuler(dAtA, i, uint64(len(m.State)))
1205 i--
1206 dAtA[i] = 0x2a
1207 }
1208 if len(m.Type) > 0 {
1209 i -= len(m.Type)
1210 copy(dAtA[i:], m.Type)
1211 i = encodeVarintRuler(dAtA, i, uint64(len(m.Type)))
1212 i--
1213 dAtA[i] = 0x22
1214 }
1215 if len(m.Files) > 0 {

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 1

encodeVarintRulerFunction · 0.85

Tested by

no test coverage detected