selectors

package
v1.2.16 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package selectors provides the ability to work with a collection of label selectors

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LabelsFromSets

func LabelsFromSets(s []labels.Set) []labels.Labels

LabelsFromSets converts from a slice of labels.Set to a its interface (labels.Labels).

Types

type LabelSelectorSet

type LabelSelectorSet []labels.Selector

LabelSelectorSet represents a set of selectors

func Everything

func Everything() LabelSelectorSet

Everything matches everything

func Nothing

func Nothing() LabelSelectorSet

Nothing matches nothing

func Parse

func Parse(selectors []string) (LabelSelectorSet, error)

Parse will parse an array of strings to create a LabelSelectorSet If selectors is nil then we match everything this matches everything If selectors is empty then we match nothing (no selector will ever match since there are none)

func (LabelSelectorSet) MatchAll

func (lss LabelSelectorSet) MatchAll(lbls []labels.Labels) bool

MatchAll returns true if the selector set matches all of the label sets

func (LabelSelectorSet) MatchAny

func (lss LabelSelectorSet) MatchAny(lbls []labels.Labels) bool

MatchAny returns true if the selector set matches any of the label sets

func (LabelSelectorSet) Matches

func (lss LabelSelectorSet) Matches(l labels.Labels) bool

Matches will return true if any of the selectors match (this implements the OR condition)

Jump to

Keyboard shortcuts

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