labelrestrictionindex

package
v1.11.0-cni-plu...-8a901cc Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0, Apache-2.0 Imports: 5 Imported by: 0

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]

Jump to

Keyboard shortcuts

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