Documentation ¶
Overview ¶
Package query is a wrapper for Kubernetes Labels Selector (KLS). Wrapping KLS allows us to expose a simpler struct to other packages in this project. The simpler struct is also more flexible as it is agnostic to KLS, meaning we can add another query language in the future and not have to modify other packages in this project that import this query package. Lastly, the simpler struct is easier to mock and test with.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Debug = false
Functions ¶
func IsInvalidLabelChar ¶ added in v0.11.0
IsInvalidLabelChar returns true if the character is invalid for a label.
Types ¶
type Requirement ¶ added in v0.11.0
type Requirement struct { Label string Op string Values []string // contains filtered or unexported fields }
A Requirement represents one predicate parsed from a selector. For example, selector "x=y,z" has two requirements: "x=y" and "z". Op is the literal operator, or "exists" (p) or "notexists" (!p).
func Parse ¶ added in v0.11.0
func Parse(selector string) ([]Requirement, error)
Parse parses a Kubernetes Label Selector sttring.