Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultJSONPathParser = NewJSONPathParser()
Functions ¶
func RelaxedJSONPathExpression ¶
copied from kubectl
Types ¶
type ESImporter ¶
type ESImporter struct {
// contains filtered or unexported fields
}
ESImporter is the struct responsible for importing data to an Elasticsearch storage.
func NewESImporter ¶
func NewESImporter(esClient *elasticsearch.Storage, cluster string, gvr schema.GroupVersionResource) *ESImporter
NewESImporter creates a new instance of the ESImporter struct with the provided Elasticsearch client, cluster name, and GroupVersionResource.
type ESListerGetter ¶
type ESListerGetter struct {
// contains filtered or unexported fields
}
func NewESListerGetter ¶
func NewESListerGetter(cluster string, esClient *elasticsearch.Storage, gvr schema.GroupVersionResource) *ESListerGetter
NewESListerGetter creates a new instance of the ESListerGetter with the provided cluster name, Elasticsearch client, and GroupVersionResource.
func (*ESListerGetter) GetByKey ¶
func (e *ESListerGetter) GetByKey(key string) (value interface{}, exists bool, err error)
GetByKey retrieves the value associated with the provided key from the managed resources.
func (*ESListerGetter) ListKeys ¶
func (e *ESListerGetter) ListKeys() []string
ListKeys returns a list of keys for the resources managed by the ESListerGetter.
type FieldsSelector ¶
FieldsSelector represents a selection based on fields.
func (FieldsSelector) Empty ¶
func (fs FieldsSelector) Empty() bool
Empty checks if the FieldsSelector is empty, meaning no fields are specified for selection.
type JSONPathFields ¶
type JSONPathFields struct {
// contains filtered or unexported fields
}
JSONPathFields is a struct that holds a JSONPathParser instance and the data to be queried by JSONPath expressions.
func NewJSONPathFields ¶
func NewJSONPathFields(jpParser *JSONPathParser, data interface{}) *JSONPathFields
NewJSONPathFields creates and returns a new instance of JSONPathFields with the given parser and data.
func (JSONPathFields) Get ¶
func (fs JSONPathFields) Get(fieldPath string) (value string)
Get retrieves the value at the specified JSONPath expression from the data and returns it as a string.
func (JSONPathFields) Has ¶
func (fs JSONPathFields) Has(fieldPath string) (exists bool)
Has checks if the given JSONPath expression exists in the data, returning a boolean indicating its existence.
type JSONPathParser ¶
JSONPathParser is a struct that holds a cache of parsed JSONPath expressions for efficient reuse.
func NewJSONPathParser ¶
func NewJSONPathParser() *JSONPathParser
NewJSONPathParser creates and returns a new instance of JSONPathParser with an empty cache.
type MultiSelectors ¶
type MultiSelectors []Selector
MultiSelectors is a slice of Selectors, allowing for multiple selection criteria to be combined.
func (MultiSelectors) ApplyToList ¶
func (m MultiSelectors) ApplyToList(options *metav1.ListOptions)
ApplyToList applies the MultiSelectors to the provided metav1.ListOptions for use in Kubernetes API list requests.
func (MultiSelectors) Matches ¶
func (m MultiSelectors) Matches(obj Selectable) bool
Matches checks if the provided Selectable object matches any of the selection criteria specified in the MultiSelectors.
func (MultiSelectors) Predicate ¶
func (m MultiSelectors) Predicate(obj interface{}) bool
Predicate returns a function that implements the Predicate interface, allowing the MultiSelectors to be used as a go-restful Predicate.
type Selectable ¶
Selectable defines the interface for objects that can be selected by labels and fields.
type Selector ¶
type Selector struct { Label labels.Selector Field FieldsSelector }
Selector represents a selection based on labels and fields.
func (Selector) Matches ¶
func (s Selector) Matches(obj Selectable) bool
Matches checks if the provided Selectable object matches the selection criteria specified by the Selector.
func (Selector) ServerSupported ¶
ServerSupported checks if the server supports the fields and labels specified in the Selector.