Documentation ¶
Index ¶
- type AllNode
- type AndNode
- type GlobalNode
- type HasNode
- type LabelContainsValueNode
- type LabelEndsWithValueNode
- type LabelEqValueNode
- type LabelInSetNode
- type LabelNeValueNode
- type LabelNotInSetNode
- type LabelRestriction
- type LabelStartsWithValueNode
- type Labels
- type MapAsLabels
- type NotNode
- type OrNode
- type PrefixVisitor
- type Selector
- type StringSet
- type Visitor
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AllNode ¶
type AllNode struct { }
func (*AllNode) AcceptVisitor ¶
func (*AllNode) LabelRestrictions ¶
func (node *AllNode) LabelRestrictions() map[string]LabelRestriction
type AndNode ¶
type AndNode struct {
Operands []node
}
func (*AndNode) AcceptVisitor ¶
func (*AndNode) LabelRestrictions ¶
func (node *AndNode) LabelRestrictions() map[string]LabelRestriction
type GlobalNode ¶
type GlobalNode struct { }
func (*GlobalNode) AcceptVisitor ¶
func (node *GlobalNode) AcceptVisitor(v Visitor)
func (*GlobalNode) Evaluate ¶
func (node *GlobalNode) Evaluate(labels Labels) bool
func (*GlobalNode) LabelRestrictions ¶
func (node *GlobalNode) LabelRestrictions() map[string]LabelRestriction
type HasNode ¶
type HasNode struct {
LabelName string
}
func (*HasNode) AcceptVisitor ¶
func (*HasNode) LabelRestrictions ¶
func (node *HasNode) LabelRestrictions() map[string]LabelRestriction
type LabelContainsValueNode ¶
func (*LabelContainsValueNode) AcceptVisitor ¶
func (node *LabelContainsValueNode) AcceptVisitor(v Visitor)
func (*LabelContainsValueNode) Evaluate ¶
func (node *LabelContainsValueNode) Evaluate(labels Labels) bool
func (*LabelContainsValueNode) LabelRestrictions ¶
func (node *LabelContainsValueNode) LabelRestrictions() map[string]LabelRestriction
type LabelEndsWithValueNode ¶
func (*LabelEndsWithValueNode) AcceptVisitor ¶
func (node *LabelEndsWithValueNode) AcceptVisitor(v Visitor)
func (*LabelEndsWithValueNode) Evaluate ¶
func (node *LabelEndsWithValueNode) Evaluate(labels Labels) bool
func (*LabelEndsWithValueNode) LabelRestrictions ¶
func (node *LabelEndsWithValueNode) LabelRestrictions() map[string]LabelRestriction
type LabelEqValueNode ¶
func (*LabelEqValueNode) AcceptVisitor ¶
func (node *LabelEqValueNode) AcceptVisitor(v Visitor)
func (*LabelEqValueNode) Evaluate ¶
func (node *LabelEqValueNode) Evaluate(labels Labels) bool
func (*LabelEqValueNode) LabelRestrictions ¶
func (node *LabelEqValueNode) LabelRestrictions() map[string]LabelRestriction
type LabelInSetNode ¶
func (*LabelInSetNode) AcceptVisitor ¶
func (node *LabelInSetNode) AcceptVisitor(v Visitor)
func (*LabelInSetNode) Evaluate ¶
func (node *LabelInSetNode) Evaluate(labels Labels) bool
func (*LabelInSetNode) LabelRestrictions ¶
func (node *LabelInSetNode) LabelRestrictions() map[string]LabelRestriction
type LabelNeValueNode ¶
func (*LabelNeValueNode) AcceptVisitor ¶
func (node *LabelNeValueNode) AcceptVisitor(v Visitor)
func (*LabelNeValueNode) Evaluate ¶
func (node *LabelNeValueNode) Evaluate(labels Labels) bool
func (*LabelNeValueNode) LabelRestrictions ¶
func (node *LabelNeValueNode) LabelRestrictions() map[string]LabelRestriction
type LabelNotInSetNode ¶
func (*LabelNotInSetNode) AcceptVisitor ¶
func (node *LabelNotInSetNode) AcceptVisitor(v Visitor)
func (*LabelNotInSetNode) Evaluate ¶
func (node *LabelNotInSetNode) Evaluate(labels Labels) bool
func (*LabelNotInSetNode) LabelRestrictions ¶
func (node *LabelNotInSetNode) LabelRestrictions() map[string]LabelRestriction
type LabelRestriction ¶
type LabelRestriction struct { // MustBePresent is true if this label must be present for the selector to // match. For example "has(labelName)" or "labelName == 'foo'" MustBePresent bool // MustBeAbsent is true if this label must be absent for this selector to // match. For example "!has(labelName)". MustBeAbsent bool // MustHaveOneOfValues if non-nil, indicates that the label must have one // of the listed values in order to match the selector. // // If nil, no such restriction is known. For example "has(labelName)" // // Note: non-nil empty slice means "selector cannot match anything". For // example an inconsistent selector such as: "a == 'B' && a == 'C'" MustHaveOneOfValues []string }
func (LabelRestriction) PossibleToSatisfy ¶
func (r LabelRestriction) PossibleToSatisfy() bool
type LabelStartsWithValueNode ¶
func (*LabelStartsWithValueNode) AcceptVisitor ¶
func (node *LabelStartsWithValueNode) AcceptVisitor(v Visitor)
func (*LabelStartsWithValueNode) Evaluate ¶
func (node *LabelStartsWithValueNode) Evaluate(labels Labels) bool
func (*LabelStartsWithValueNode) LabelRestrictions ¶
func (node *LabelStartsWithValueNode) LabelRestrictions() map[string]LabelRestriction
type Labels ¶
type Labels interface { // Get returns value and presence of the given labelName Get(labelName string) (value string, present bool) }
Labels defines the interface of labels that can be used by selector
type MapAsLabels ¶
MapAsLabels allows you use map as labels
type NotNode ¶
type NotNode struct {
Operand node
}
func (*NotNode) AcceptVisitor ¶
func (*NotNode) LabelRestrictions ¶
func (node *NotNode) LabelRestrictions() map[string]LabelRestriction
type OrNode ¶
type OrNode struct {
Operands []node
}
func (*OrNode) AcceptVisitor ¶
func (*OrNode) LabelRestrictions ¶
func (node *OrNode) LabelRestrictions() map[string]LabelRestriction
type PrefixVisitor ¶
type PrefixVisitor struct {
Prefix string
}
PrefixVisitor implements the Visitor interface to allow prefixing of label names within a selector.
func (PrefixVisitor) Visit ¶
func (v PrefixVisitor) Visit(n interface{})
type Selector ¶
type Selector interface { // Evaluate evaluates the selector against the given labels expressed as a concrete map. Evaluate(labels map[string]string) bool // EvaluateLabels evaluates the selector against the given labels expressed as an interface. // This allows for labels that are calculated on the fly. EvaluateLabels(labels Labels) bool // String returns a string that represents this selector. String() string // UniqueID returns the unique ID that represents this selector. UniqueID() string // AcceptVisitor allows an external visitor to modify this selector. AcceptVisitor(v Visitor) LabelRestrictions() map[string]LabelRestriction }
Selector represents a label selector.
Click to show internal directories.
Click to hide internal directories.