selector

package
v1.11.0-cni-plu...-ddfc3b1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalise

func Normalise(selector string) string

Normalise converts the given selector to the form returned by Selector.String(), i.e. "" is converted to "all()" and whitespace is tidied up. If the input string cannot be parsed, it is returned unaltered.

Types

type Selector

type Selector interface {
	// Evaluate evaluates the selector against the given labels expressed as a concrete map.
	Evaluate(labels map[string]string) bool

	// EvaluateLabels evaluates the selector against the given labels expressed as an interface.
	// This allows for labels that are calculated on the fly.
	EvaluateLabels(labels parser.Labels) bool

	// String returns a string that represents this selector.
	String() string

	// UniqueID returns the unique ID that represents this selector.
	UniqueID() string

	LabelRestrictions() map[string]parser.LabelRestriction
}

Selector represents a label selector.

func Parse

func Parse(selector string) (sel Selector, err error)

Parse a string representation of a selector expression into a Selector.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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