selector

package
v0.0.0-...-c16a028 Latest Latest
Warning

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

Go to latest
Published: Apr 3, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BoolProperty

type BoolProperty bool

BoolProperty defines a bool type that methods can hang off of.

func (BoolProperty) Matches

func (p BoolProperty) Matches(b bool) bool

Matches checks if the provided bool matches the BoolProperty.

type GlobProperty

type GlobProperty string

GlobProperty defines a string type that can contain glob for matching against.

func (GlobProperty) Matches

func (g GlobProperty) Matches(s string) bool

Matches checks if the provided string matches the GlobProperty.

type IntProperty

type IntProperty int

IntProperty defines an int type that methods can hang off of.

func (IntProperty) Matches

func (p IntProperty) Matches(i int) bool

Matches checks if the provided int matches the IntProperty.

type QuantityComparator

type QuantityComparator struct {
	Value    resource.Quantity          `json:"value,omitempty"`
	Operator QuantityComparatorOperator `json:"operator,omitempty"`
}

QuantityComparator compares a quantity SelectorCondition using a specific operator.

func (*QuantityComparator) DeepCopy

func (in *QuantityComparator) DeepCopy() *QuantityComparator

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new QuantityComparator.

func (*QuantityComparator) DeepCopyInto

func (in *QuantityComparator) DeepCopyInto(out *QuantityComparator)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*QuantityComparator) Matches

func (c *QuantityComparator) Matches(quantity *resource.Quantity) bool

Matches checks if 'version' matches the semantics of the QuantityComparator.

type QuantityComparatorOperator

type QuantityComparatorOperator string

QuantityComparatorOperator defines the operators for use with a QuantityComparator. +kubebuilder:validation:Enum=Equals;LessThan;LessThanOrEqualTo;GreaterThan;GreaterThanOrEqualTo

type Selector

type Selector[T any] struct {
	Properties    *T
	AndExpression []Selector[T]
	OrExpression  []Selector[T]
}

Selector defines the set of conditions that can be used to select on a set of properties As a first level of nesting, either a single property can be selected or the conditions can be 'anded' or 'ored' together +k8s:deepcopy-gen=false

func (Selector[T]) Matches

func (s Selector[T]) Matches(compare func(*T) bool) bool

Matches evaluates a Selector to see if it matches the boolean expression it represents. Each individual Properties object is passed to the caller via a callback to compare it in isolation before combining the results.

type SelectorList

type SelectorList[T any] []Selector[T]

SelectorList is a list of Selectors +k8s:deepcopy-gen=false

func (SelectorList[T]) And

func (l SelectorList[T]) And(compare func(*T) bool) bool

And runs an 'and' operation between each element in SelectorList. Each individual Properties object is passed to the caller via a callback to compare it in isolation before combining the results.

func (SelectorList[T]) Or

func (l SelectorList[T]) Or(compare func(*T) bool) bool

Or runs an 'or' operation between each element in SelectorList. Each individual Properties object is passed to the caller via a callback to compare it in isolation before combining the results.

type StringProperty

type StringProperty string

StringProperty defines a string type that methods can hang off of.

func (StringProperty) Matches

func (p StringProperty) Matches(s string) bool

Matches checks if the provided string matches the StringProperty.

type VersionComparator

type VersionComparator struct {
	Value    string                    `json:"value,omitempty"`
	Operator VersionComparatorOperator `json:"operator,omitempty"`
}

VersionComparator compares a version SelectorCondition using a specific operator.

func (*VersionComparator) DeepCopy

func (in *VersionComparator) DeepCopy() *VersionComparator

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VersionComparator.

func (*VersionComparator) DeepCopyInto

func (in *VersionComparator) DeepCopyInto(out *VersionComparator)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*VersionComparator) Matches

func (c *VersionComparator) Matches(version string) bool

Matches checks if a 'version' matches the semantics of the VersionComparator.

type VersionComparatorOperator

type VersionComparatorOperator string

VersionComparatorOperator defines the operators for use with a VersionComparator. +kubebuilder:validation:Enum=Equals;LessThan;LessThanOrEqualTo;GreaterThan;GreaterThanOrEqualTo

Jump to

Keyboard shortcuts

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