utils

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultJSONPathParser = NewJSONPathParser()

Functions

func RelaxedJSONPathExpression

func RelaxedJSONPathExpression(pathExpression string) (string, error)

copied from kubectl

Types

type FieldsSelector

type FieldsSelector struct {
	fields.Selector
	ServerSupported bool
}

func (FieldsSelector) Empty

func (fs FieldsSelector) Empty() bool

type JSONPathFields

type JSONPathFields struct {
	// contains filtered or unexported fields
}

func NewJSONPathFields

func NewJSONPathFields(jpParser *JSONPathParser, data interface{}) *JSONPathFields

func (JSONPathFields) Get

func (fs JSONPathFields) Get(fieldPath string) (value string)

func (JSONPathFields) Has

func (fs JSONPathFields) Has(fieldPath string) (exists bool)

type JSONPathParser

type JSONPathParser struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewJSONPathParser

func NewJSONPathParser() *JSONPathParser

func (*JSONPathParser) Parse

func (j *JSONPathParser) Parse(path string) (*jsonpath.JSONPath, error)

type MultiSelectors

type MultiSelectors []Selector

func (MultiSelectors) ApplyToList

func (m MultiSelectors) ApplyToList(options *metav1.ListOptions)

func (MultiSelectors) Matches

func (m MultiSelectors) Matches(obj Selectable) bool

func (MultiSelectors) Predicate

func (m MultiSelectors) Predicate(obj interface{}) bool

type Selectable

type Selectable interface {
	GetLabels() labels.Labels
	GetFields() fields.Fields
}

type Selector

type Selector struct {
	Label labels.Selector
	Field FieldsSelector
}

func (Selector) Matches

func (s Selector) Matches(obj Selectable) bool

func (Selector) ServerSupported

func (s Selector) ServerSupported() bool

Jump to

Keyboard shortcuts

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