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

Method MarshalToSizedBuffer

pkg/cortexpb/cortex.pb.go:2555–2630  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

2553}
2554
2555func (m *WriteRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2556 i := len(dAtA)
2557 _ = i
2558 var l int
2559 _ = l
2560 if m.DiscardOutOfOrder {
2561 i--
2562 if m.DiscardOutOfOrder {
2563 dAtA[i] = 1
2564 } else {
2565 dAtA[i] = 0
2566 }
2567 i--
2568 dAtA[i] = 0x3e
2569 i--
2570 dAtA[i] = 0xd0
2571 }
2572 {
2573 size := m.MessageWithBufRef.Size()
2574 i -= size
2575 if _, err := m.MessageWithBufRef.MarshalTo(dAtA[i:]); err != nil {
2576 return 0, err
2577 }
2578 i = encodeVarintCortex(dAtA, i, uint64(size))
2579 }
2580 i--
2581 dAtA[i] = 0x3e
2582 i--
2583 dAtA[i] = 0xca
2584 if m.SkipLabelNameValidation {
2585 i--
2586 if m.SkipLabelNameValidation {
2587 dAtA[i] = 1
2588 } else {
2589 dAtA[i] = 0
2590 }
2591 i--
2592 dAtA[i] = 0x3e
2593 i--
2594 dAtA[i] = 0xc0
2595 }
2596 if len(m.Metadata) > 0 {
2597 for iNdEx := len(m.Metadata) - 1; iNdEx >= 0; iNdEx-- {
2598 {
2599 size, err := m.Metadata[iNdEx].MarshalToSizedBuffer(dAtA[:i])
2600 if err != nil {
2601 return 0, err
2602 }
2603 i -= size
2604 i = encodeVarintCortex(dAtA, i, uint64(size))
2605 }
2606 i--
2607 dAtA[i] = 0x1a
2608 }
2609 }
2610 if m.Source != 0 {
2611 i = encodeVarintCortex(dAtA, i, uint64(m.Source))
2612 i--

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 4

encodeVarintCortexFunction · 0.85
SizeMethod · 0.65
MarshalToMethod · 0.65
MarshalToSizedBufferMethod · 0.65

Tested by

no test coverage detected