filter

package
v0.1.42 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToSelector

func ConvertToSelector(p Predicate) (labels.Selector, error)

ConvertToSelector converts Predicate to a labels.Selector

func ExtractProperty

func ExtractProperty(restriction string) string

ExtractProperty extracts the property from the given restriction E.g., for the restriction "spec.externalName=foo", the function returns "spec.externalName"

Types

type Predicate

type Predicate interface {
	// Accepts returns true if this predicate accepts the given set of properties.
	Accepts(Properties) bool

	// Empty returns true if this predicate does not restrict the acceptance space.
	Empty() bool

	// String returns a human readable string that represents this predicate.
	String() string
}

Predicate is used to test if the set of rules accepts the properties given. Predicate wraps label.Selector allowing us to use label selectors.

func CreatePredicate

func CreatePredicate(restrictions []string) (Predicate, error)

CreatePredicate creates the Predicate that will be used to test if acceptance is allowed for service classes.

func NewPredicate

func NewPredicate() Predicate

NewPredicate returns a empty predicate

type Properties

type Properties labels.Labels

Properties allows you to present properties independently from their storage.

Jump to

Keyboard shortcuts

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