Documentation
¶
Index ¶
- Variables
- func ApplyCrds(ctx context.Context, dynamicClient dynamic.Interface) error
- func ConvertToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
- func CreateOrUpdateUnstructured(ctx context.Context, dynamicClient dynamic.Interface, ...) error
- func GetSyncGVK(gvk schema.GroupVersionKind) (searchv1beta1.ResourceSyncRule, bool)
- func SetSyncGVK(gvk schema.GroupVersionKind, rule searchv1beta1.ResourceSyncRule)
- type ESImporter
- type ESListerGetter
- type ESPurger
- type FieldsSelector
- type Importer
- type MultiSelectors
- type Purger
- type Selectable
- type Selector
Constants ¶
This section is empty.
Variables ¶
var (
ZeroVal = searchv1beta1.ResourceSyncRule{}
)
Functions ¶
func ConvertToUnstructured ¶
func ConvertToUnstructured(obj runtime.Object) (*unstructured.Unstructured, error)
ConvertToUnstructured converts the structured object to unstructured
func CreateOrUpdateUnstructured ¶
func CreateOrUpdateUnstructured(ctx context.Context, dynamicClient dynamic.Interface, gvr schema.GroupVersionResource, namespace string, newObject *unstructured.Unstructured) error
CreateOrUpdateUnstructured creates or updates object using dynamic client.
func GetSyncGVK ¶
func GetSyncGVK(gvk schema.GroupVersionKind) (searchv1beta1.ResourceSyncRule, bool)
func SetSyncGVK ¶
func SetSyncGVK(gvk schema.GroupVersionKind, rule searchv1beta1.ResourceSyncRule)
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 ESPurger ¶ added in v0.5.5
type ESPurger struct {
// contains filtered or unexported fields
}
func NewESPurger ¶ added in v0.5.5
func NewESPurger(esClient *elasticsearch.Storage, cluster string, gvr schema.GroupVersionResource, store cache.Store, onPurge func(obj client.Object), ) *ESPurger
NewESPurger creates an ESPurger which implements the Purger interface.
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 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.