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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

1309}
1310
1311func (m *RulesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
1312 i := len(dAtA)
1313 _ = i
1314 var l int
1315 _ = l
1316 if len(m.NextToken) > 0 {
1317 i -= len(m.NextToken)
1318 copy(dAtA[i:], m.NextToken)
1319 i = encodeVarintRuler(dAtA, i, uint64(len(m.NextToken)))
1320 i--
1321 dAtA[i] = 0x12
1322 }
1323 if len(m.Groups) > 0 {
1324 for iNdEx := len(m.Groups) - 1; iNdEx >= 0; iNdEx-- {
1325 {
1326 size, err := m.Groups[iNdEx].MarshalToSizedBuffer(dAtA[:i])
1327 if err != nil {
1328 return 0, err
1329 }
1330 i -= size
1331 i = encodeVarintRuler(dAtA, i, uint64(size))
1332 }
1333 i--
1334 dAtA[i] = 0xa
1335 }
1336 }
1337 return len(dAtA) - i, nil
1338}
1339
1340func (m *GroupStateDesc) Marshal() (dAtA []byte, err error) {
1341 size := m.Size()

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