parser

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2020 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllNode

type AllNode struct {
}

func (*AllNode) AcceptVisitor added in v1.7.4

func (node *AllNode) AcceptVisitor(v Visitor)

func (*AllNode) Evaluate

func (node *AllNode) Evaluate(labels Labels) bool

type AndNode

type AndNode struct {
	Operands []node
}

func (*AndNode) AcceptVisitor added in v1.7.4

func (node *AndNode) AcceptVisitor(v Visitor)

func (*AndNode) Evaluate

func (node *AndNode) Evaluate(labels Labels) bool

type HasNode

type HasNode struct {
	LabelName string
}

func (*HasNode) AcceptVisitor added in v1.7.4

func (node *HasNode) AcceptVisitor(v Visitor)

func (*HasNode) Evaluate

func (node *HasNode) Evaluate(labels Labels) bool

type LabelContainsValueNode added in v1.7.4

type LabelContainsValueNode struct {
	LabelName string
	Value     string
}

func (*LabelContainsValueNode) AcceptVisitor added in v1.7.4

func (node *LabelContainsValueNode) AcceptVisitor(v Visitor)

func (*LabelContainsValueNode) Evaluate added in v1.7.4

func (node *LabelContainsValueNode) Evaluate(labels Labels) bool

type LabelEndsWithValueNode added in v1.7.4

type LabelEndsWithValueNode struct {
	LabelName string
	Value     string
}

func (*LabelEndsWithValueNode) AcceptVisitor added in v1.7.4

func (node *LabelEndsWithValueNode) AcceptVisitor(v Visitor)

func (*LabelEndsWithValueNode) Evaluate added in v1.7.4

func (node *LabelEndsWithValueNode) Evaluate(labels Labels) bool

type LabelEqValueNode

type LabelEqValueNode struct {
	LabelName string
	Value     string
}

func (*LabelEqValueNode) AcceptVisitor added in v1.7.4

func (node *LabelEqValueNode) AcceptVisitor(v Visitor)

func (*LabelEqValueNode) Evaluate

func (node *LabelEqValueNode) Evaluate(labels Labels) bool

type LabelInSetNode

type LabelInSetNode struct {
	LabelName string
	Value     StringSet
}

func (*LabelInSetNode) AcceptVisitor added in v1.7.4

func (node *LabelInSetNode) AcceptVisitor(v Visitor)

func (*LabelInSetNode) Evaluate

func (node *LabelInSetNode) Evaluate(labels Labels) bool

type LabelNeValueNode

type LabelNeValueNode struct {
	LabelName string
	Value     string
}

func (*LabelNeValueNode) AcceptVisitor added in v1.7.4

func (node *LabelNeValueNode) AcceptVisitor(v Visitor)

func (*LabelNeValueNode) Evaluate

func (node *LabelNeValueNode) Evaluate(labels Labels) bool

type LabelNotInSetNode

type LabelNotInSetNode struct {
	LabelName string
	Value     StringSet
}

func (*LabelNotInSetNode) AcceptVisitor added in v1.7.4

func (node *LabelNotInSetNode) AcceptVisitor(v Visitor)

func (*LabelNotInSetNode) Evaluate

func (node *LabelNotInSetNode) Evaluate(labels Labels) bool

type LabelStartsWithValueNode added in v1.7.4

type LabelStartsWithValueNode struct {
	LabelName string
	Value     string
}

func (*LabelStartsWithValueNode) AcceptVisitor added in v1.7.4

func (node *LabelStartsWithValueNode) AcceptVisitor(v Visitor)

func (*LabelStartsWithValueNode) Evaluate added in v1.7.4

func (node *LabelStartsWithValueNode) Evaluate(labels Labels) bool

type Labels added in v1.2.0

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 added in v1.2.0

type MapAsLabels map[string]string

MapAsLabels allows you use map as labels

func (MapAsLabels) Get added in v1.2.0

func (l MapAsLabels) Get(labelName string) (value string, present bool)

Get returns the value and presence of the given labelName key in the MapAsLabels

type NotNode

type NotNode struct {
	Operand node
}

func (*NotNode) AcceptVisitor added in v1.7.4

func (node *NotNode) AcceptVisitor(v Visitor)

func (*NotNode) Evaluate

func (node *NotNode) Evaluate(labels Labels) bool

type OrNode

type OrNode struct {
	Operands []node
}

func (*OrNode) AcceptVisitor added in v1.7.4

func (node *OrNode) AcceptVisitor(v Visitor)

func (*OrNode) Evaluate

func (node *OrNode) Evaluate(labels Labels) bool

type PrefixVisitor added in v1.7.4

type PrefixVisitor struct {
	Prefix string
}

PrefixVisitor implements the Visitor interface to allow prefixing of label names within a selector.

func (PrefixVisitor) Visit added in v1.7.4

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)
}

Selector represents a label selector.

func Parse

func Parse(selector string) (sel Selector, err error)

Parse parses a string representation of a selector expression into a Selector.

type StringSet

type StringSet []string

func ConvertToStringSetInPlace

func ConvertToStringSetInPlace(s []string) StringSet

func (StringSet) Contains

func (ss StringSet) Contains(s string) bool

Contains returns true if a given string in current set

type Visitor added in v1.7.4

type Visitor interface {
	Visit(n interface{})
}

Jump to

Keyboard shortcuts

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