labelpb

package
v0.16.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 17, 2020 License: Apache-2.0 Imports: 11 Imported by: 24

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)

Functions

func ExtendLabels

func ExtendLabels(lset labels.Labels, extend labels.Labels) labels.Labels

ExtendLabels extend given labels by extend in labels format. The type conversion is done safely, which means we don't modify extend labels underlying array.

In case of existing labels already present in given label set, it will be overwritten by external one.

func LabelSetsToPromLabelSets

func LabelSetsToPromLabelSets(lss ...LabelSet) []labels.Labels

LabelSetsToPromLabelSets converts slice of storepb.LabelSet to slice of Prometheus labels.

func LabelsToPromLabels

func LabelsToPromLabels(lset []Label) labels.Labels

LabelsToPromLabels convert slice of storepb.Label to Prometheus labels in type unsafe manner. It reuses the same memory. Caller should abort using passed []Label.

func PromLabelSetsToString

func PromLabelSetsToString(lsets []labels.Labels) string

Types

type FullCopyLabel

type FullCopyLabel struct {
	Name  string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"`
}

func (*FullCopyLabel) Descriptor

func (*FullCopyLabel) Descriptor() ([]byte, []int)

func (*FullCopyLabel) Marshal

func (m *FullCopyLabel) Marshal() (dAtA []byte, err error)

func (*FullCopyLabel) MarshalTo

func (m *FullCopyLabel) MarshalTo(dAtA []byte) (int, error)

func (*FullCopyLabel) MarshalToSizedBuffer

func (m *FullCopyLabel) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FullCopyLabel) ProtoMessage

func (*FullCopyLabel) ProtoMessage()

func (*FullCopyLabel) Reset

func (m *FullCopyLabel) Reset()

func (*FullCopyLabel) Size

func (m *FullCopyLabel) Size() (n int)

func (*FullCopyLabel) String

func (m *FullCopyLabel) String() string

func (*FullCopyLabel) Unmarshal

func (m *FullCopyLabel) Unmarshal(dAtA []byte) error

func (*FullCopyLabel) XXX_DiscardUnknown

func (m *FullCopyLabel) XXX_DiscardUnknown()

func (*FullCopyLabel) XXX_Marshal

func (m *FullCopyLabel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FullCopyLabel) XXX_Merge

func (m *FullCopyLabel) XXX_Merge(src proto.Message)

func (*FullCopyLabel) XXX_Size

func (m *FullCopyLabel) XXX_Size() int

func (*FullCopyLabel) XXX_Unmarshal

func (m *FullCopyLabel) XXX_Unmarshal(b []byte) error

type FullCopyLabelSet

type FullCopyLabelSet struct {
	Labels []FullCopyLabel `protobuf:"bytes,1,rep,name=labels,proto3" json:"labels"`
}

func (*FullCopyLabelSet) Descriptor

func (*FullCopyLabelSet) Descriptor() ([]byte, []int)

func (*FullCopyLabelSet) Marshal

func (m *FullCopyLabelSet) Marshal() (dAtA []byte, err error)

func (*FullCopyLabelSet) MarshalTo

func (m *FullCopyLabelSet) MarshalTo(dAtA []byte) (int, error)

func (*FullCopyLabelSet) MarshalToSizedBuffer

func (m *FullCopyLabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*FullCopyLabelSet) ProtoMessage

func (*FullCopyLabelSet) ProtoMessage()

func (*FullCopyLabelSet) Reset

func (m *FullCopyLabelSet) Reset()

func (*FullCopyLabelSet) Size

func (m *FullCopyLabelSet) Size() (n int)

func (*FullCopyLabelSet) String

func (m *FullCopyLabelSet) String() string

func (*FullCopyLabelSet) Unmarshal

func (m *FullCopyLabelSet) Unmarshal(dAtA []byte) error

func (*FullCopyLabelSet) XXX_DiscardUnknown

func (m *FullCopyLabelSet) XXX_DiscardUnknown()

func (*FullCopyLabelSet) XXX_Marshal

func (m *FullCopyLabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*FullCopyLabelSet) XXX_Merge

func (m *FullCopyLabelSet) XXX_Merge(src proto.Message)

func (*FullCopyLabelSet) XXX_Size

func (m *FullCopyLabelSet) XXX_Size() int

func (*FullCopyLabelSet) XXX_Unmarshal

func (m *FullCopyLabelSet) XXX_Unmarshal(b []byte) error

type Label

type Label = FullCopyLabel

Label is a FullCopyLabel. This is quick fix for https://github.com/thanos-io/thanos/issues/3265. TODO(bwplotka): Replace with https://github.com/thanos-io/thanos/pull/3279

func LabelsFromPromLabels

func LabelsFromPromLabels(lset labels.Labels) []Label

LabelsFromPromLabels converts Prometheus labels to slice of storepb.Label in type unsafe manner. It reuses the same memory. Caller should abort using passed labels.Labels.

func (*Label) Compare

func (m *Label) Compare(other Label) int

Compare implements proto.Comparer.

func (*Label) Equal

func (m *Label) Equal(other Label) bool

Equal implements proto.Equaler.

type LabelSet

type LabelSet struct {
	Labels []Label `protobuf:"bytes,1,rep,name=labels,proto3,customtype=Label" json:"labels"`
}

func (*LabelSet) Descriptor

func (*LabelSet) Descriptor() ([]byte, []int)

func (*LabelSet) Marshal

func (m *LabelSet) Marshal() (dAtA []byte, err error)

func (*LabelSet) MarshalJSON

func (m *LabelSet) MarshalJSON() ([]byte, error)

func (*LabelSet) MarshalTo

func (m *LabelSet) MarshalTo(dAtA []byte) (int, error)

func (*LabelSet) MarshalToSizedBuffer

func (m *LabelSet) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*LabelSet) PromLabels

func (m *LabelSet) PromLabels() labels.Labels

PromLabels return Prometheus labels.Labels without extra allocation.

func (*LabelSet) ProtoMessage

func (*LabelSet) ProtoMessage()

func (*LabelSet) Reset

func (m *LabelSet) Reset()

func (*LabelSet) Size

func (m *LabelSet) Size() (n int)

func (*LabelSet) String

func (m *LabelSet) String() string

func (*LabelSet) Unmarshal

func (m *LabelSet) Unmarshal(dAtA []byte) error

func (*LabelSet) UnmarshalJSON

func (m *LabelSet) UnmarshalJSON(entry []byte) error

func (*LabelSet) XXX_DiscardUnknown

func (m *LabelSet) XXX_DiscardUnknown()

func (*LabelSet) XXX_Marshal

func (m *LabelSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*LabelSet) XXX_Merge

func (m *LabelSet) XXX_Merge(src proto.Message)

func (*LabelSet) XXX_Size

func (m *LabelSet) XXX_Size() int

func (*LabelSet) XXX_Unmarshal

func (m *LabelSet) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL