filter

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FiltersEqual

func FiltersEqual(f1, f2 Filter) bool

Types

type ComparableFilter

type ComparableFilter interface {
	Filter
	Equals(Filter) bool
}

func All

func All() ComparableFilter

All() returns a filter whose Accept() is always false.

func And

func And(children ...Filter) ComparableFilter

func LabelSelector

func LabelSelector(ls *metav1.LabelSelector) ComparableFilter

func Labels

func Labels(match map[string]string) ComparableFilter

Labels() returns a filter which returns true if the provided map is a subset of the object's labels.

func NSName

func NSName(ids ...nsname.NSName) ComparableFilter

NSName() returns a filter whose Accept() returns true if the object's namespace and name matches one of the given NSNames.

func Not

func Not(child Filter) ComparableFilter

func Null

func Null() ComparableFilter

Null() returns a filter whose Accept() is always true.

func Or

func Or(children ...Filter) ComparableFilter

func Selector

func Selector(selector labels.Selector) ComparableFilter

type Filter

type Filter interface {

	// Accept() should return true if the given object passes the filter.
	Accept(metav1.Object) bool
}

func FN

func FN(fn func(metav1.Object) bool) Filter

Jump to

Keyboard shortcuts

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