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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

2645}
2646
2647func (m *WriteRequestV2) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2648 i := len(dAtA)
2649 _ = i
2650 var l int
2651 _ = l
2652 {
2653 size := m.MessageWithBufRef.Size()
2654 i -= size
2655 if _, err := m.MessageWithBufRef.MarshalTo(dAtA[i:]); err != nil {
2656 return 0, err
2657 }
2658 i = encodeVarintCortex(dAtA, i, uint64(size))
2659 }
2660 i--
2661 dAtA[i] = 0x3e
2662 i--
2663 dAtA[i] = 0xca
2664 if m.SkipLabelNameValidation {
2665 i--
2666 if m.SkipLabelNameValidation {
2667 dAtA[i] = 1
2668 } else {
2669 dAtA[i] = 0
2670 }
2671 i--
2672 dAtA[i] = 0x3e
2673 i--
2674 dAtA[i] = 0xc0
2675 }
2676 if m.Source != 0 {
2677 i = encodeVarintCortex(dAtA, i, uint64(m.Source))
2678 i--
2679 dAtA[i] = 0x30
2680 }
2681 if len(m.Timeseries) > 0 {
2682 for iNdEx := len(m.Timeseries) - 1; iNdEx >= 0; iNdEx-- {
2683 {
2684 size := m.Timeseries[iNdEx].Size()
2685 i -= size
2686 if _, err := m.Timeseries[iNdEx].MarshalTo(dAtA[i:]); err != nil {
2687 return 0, err
2688 }
2689 i = encodeVarintCortex(dAtA, i, uint64(size))
2690 }
2691 i--
2692 dAtA[i] = 0x2a
2693 }
2694 }
2695 if len(m.Symbols) > 0 {
2696 for iNdEx := len(m.Symbols) - 1; iNdEx >= 0; iNdEx-- {
2697 i -= len(m.Symbols[iNdEx])
2698 copy(dAtA[i:], m.Symbols[iNdEx])
2699 i = encodeVarintCortex(dAtA, i, uint64(len(m.Symbols[iNdEx])))
2700 i--
2701 dAtA[i] = 0x22
2702 }
2703 }
2704 return len(dAtA) - i, nil

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 3

encodeVarintCortexFunction · 0.85
SizeMethod · 0.65
MarshalToMethod · 0.65

Tested by

no test coverage detected