utils

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: Apache-2.0 Imports: 15 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 ESImporter added in v0.3.1

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

func NewESImporter added in v0.3.1

func NewESImporter(esClient *elasticsearch.ESClient, cluster string, gvr schema.GroupVersionResource) *ESImporter

func (*ESImporter) ImportTo added in v0.3.1

func (e *ESImporter) ImportTo(ctx context.Context, store cache.Store) error

type ESListerGetter added in v0.3.0

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

func NewESListerGetter added in v0.3.0

func NewESListerGetter(cluster string, esClient *elasticsearch.ESClient, gvr schema.GroupVersionResource) *ESListerGetter

func (*ESListerGetter) GetByKey added in v0.3.0

func (e *ESListerGetter) GetByKey(key string) (value interface{}, exists bool, err error)

func (*ESListerGetter) ListKeys added in v0.3.0

func (e *ESListerGetter) ListKeys() []string

type FieldsSelector

type FieldsSelector struct {
	fields.Selector
	ServerSupported bool
}

func (FieldsSelector) Empty

func (fs FieldsSelector) Empty() bool

type Importer added in v0.3.1

type Importer interface {
	ImportTo(ctx context.Context, store cache.Store) error
}

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