Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Gauge ¶
type Gauge interface {
Set(float64)
}
Gauge is the sub-interface of prometheus.Gauge that we use.
type LabelRestrictionIndex ¶
type LabelRestrictionIndex[SelID comparable] struct { // contains filtered or unexported fields }
LabelRestrictionIndex indexes Selectors themselves, based on their label restrictions such that, given a Labeled resource, it can (hopefully) find a small subset of selectors that are candidate matches.
func New ¶
func New[SelID comparable](opts ...Option[SelID]) *LabelRestrictionIndex[SelID]
func (*LabelRestrictionIndex[SelID]) AddSelector ¶
func (s *LabelRestrictionIndex[SelID]) AddSelector(id SelID, selector selector.Selector)
func (*LabelRestrictionIndex[SelID]) DeleteSelector ¶
func (s *LabelRestrictionIndex[SelID]) DeleteSelector(id SelID)
func (*LabelRestrictionIndex[SelID]) IterPotentialMatches ¶
func (s *LabelRestrictionIndex[SelID]) IterPotentialMatches(item Labeled, f func(SelID, selector.Selector))
type Labeled ¶
type Labeled interface { // IterOwnAndParentLabels should produce each KV that applies to the // resource exactly once, accounting for inheritance. I.e. if // the resource and its parent have different values for the same label, // it should produce the final applicable value. IterOwnAndParentLabels(func(k, v string)) }
Labeled provides an interface for iterating over a resource's labels including any that are inherited from its parents.
type Option ¶
type Option[SelID comparable] func(index *LabelRestrictionIndex[SelID])
func WithGauges ¶
func WithGauges[SelID comparable](optimizedSelectors, unoptimisedSelectors Gauge) Option[SelID]
Click to show internal directories.
Click to hide internal directories.