filter

package
v0.0.0-...-e40a182 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EmptyOrMatchLabel

func EmptyOrMatchLabel(obj Labeled, lm LabelMatch) bool

EmptyOrMatchLabel checks EmptyOrMatch on a LabelMatch

func MatchLabel

func MatchLabel(obj Labeled, lm LabelMatch) bool

MatchLabel checks if an object satisfies the requirements of a LabelMatch

Types

type LabelMatch

type LabelMatch interface {
	Match(map[string]string) bool
	EmptyOrMatch(map[string]string) bool
}

LabelMatch is used to filter objects with labels

type LabelMatchEq

type LabelMatchEq struct {
	Key   string
	Value string
}

LabelMatchEq checks if the value of a label is equal to a value

func (*LabelMatchEq) EmptyOrMatch

func (m *LabelMatchEq) EmptyOrMatch(labels map[string]string) bool

EmptyOrMatch checks if the label can be filtered on existent fields

func (*LabelMatchEq) Match

func (m *LabelMatchEq) Match(labels map[string]string) bool

Match checks the label value for equality

type LabelMatchMultiple

type LabelMatchMultiple struct {
	Matches []LabelMatch
}

LabelMatchMultiple checks that multiple label criteria are satisfied

func (*LabelMatchMultiple) EmptyOrMatch

func (m *LabelMatchMultiple) EmptyOrMatch(labels map[string]string) bool

EmptyOrMatch checks if the label can be filtered on existent fields

func (*LabelMatchMultiple) Match

func (m *LabelMatchMultiple) Match(labels map[string]string) bool

Match checks all nested LabelMatches

type LabelMatchNeq

type LabelMatchNeq struct {
	Key   string
	Value string
}

LabelMatchNeq checks if the value of a label is non-existent or not equal to a value

func (*LabelMatchNeq) EmptyOrMatch

func (m *LabelMatchNeq) EmptyOrMatch(labels map[string]string) bool

EmptyOrMatch checks if the label can be filtered on existent fields

func (*LabelMatchNeq) Match

func (m *LabelMatchNeq) Match(labels map[string]string) bool

Match checks the label value for non-equality

type LabelMatchSetIn

type LabelMatchSetIn struct {
	Key    string
	Values []string
}

LabelMatchSetIn checks if the value of a label is non-existent or is one of multiple values

func (*LabelMatchSetIn) EmptyOrMatch

func (m *LabelMatchSetIn) EmptyOrMatch(labels map[string]string) bool

EmptyOrMatch checks if the label can be filtered on existent fields

func (*LabelMatchSetIn) Match

func (m *LabelMatchSetIn) Match(labels map[string]string) bool

Match checks the label value belongs in a set

type Labeled

type Labeled interface {
	GetLabels() map[string]string
}

Labeled is used to access labels of an object

func GetLabeled

func GetLabeled(m map[string]string) Labeled

GetLabeled returns a Labeled object that returns the passed map

type StatusMatch

type StatusMatch struct {
	State v1.PodPhase
}

StatusMatch is used to filter pods by status

Jump to

Keyboard shortcuts

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