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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

1418}
1419
1420func (m *RuleStateDesc) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1421 i := len(dAtA)
1422 _ = i
1423 var l int
1424 _ = l
1425 n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.EvaluationDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration):])
1426 if err4 != nil {
1427 return 0, err4
1428 }
1429 i -= n4
1430 i = encodeVarintRuler(dAtA, i, uint64(n4))
1431 i--
1432 dAtA[i] = 0x3a
1433 n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EvaluationTimestamp, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp):])
1434 if err5 != nil {
1435 return 0, err5
1436 }
1437 i -= n5
1438 i = encodeVarintRuler(dAtA, i, uint64(n5))
1439 i--
1440 dAtA[i] = 0x32
1441 if len(m.Alerts) > 0 {
1442 for iNdEx := len(m.Alerts) - 1; iNdEx >= 0; iNdEx-- {
1443 {
1444 size, err := m.Alerts[iNdEx].MarshalToSizedBuffer(dAtA[:i])
1445 if err != nil {
1446 return 0, err
1447 }
1448 i -= size
1449 i = encodeVarintRuler(dAtA, i, uint64(size))
1450 }
1451 i--
1452 dAtA[i] = 0x2a
1453 }
1454 }
1455 if len(m.LastError) > 0 {
1456 i -= len(m.LastError)
1457 copy(dAtA[i:], m.LastError)
1458 i = encodeVarintRuler(dAtA, i, uint64(len(m.LastError)))
1459 i--
1460 dAtA[i] = 0x22
1461 }
1462 if len(m.Health) > 0 {
1463 i -= len(m.Health)
1464 copy(dAtA[i:], m.Health)
1465 i = encodeVarintRuler(dAtA, i, uint64(len(m.Health)))
1466 i--
1467 dAtA[i] = 0x1a
1468 }
1469 if len(m.State) > 0 {
1470 i -= len(m.State)
1471 copy(dAtA[i:], m.State)
1472 i = encodeVarintRuler(dAtA, i, uint64(len(m.State)))
1473 i--
1474 dAtA[i] = 0x12
1475 }
1476 if m.Rule != nil {
1477 {

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 2

encodeVarintRulerFunction · 0.85
MarshalToSizedBufferMethod · 0.65

Tested by

no test coverage detected