Documentation ¶
Index ¶
- func FieldIndexName(field string) string
- func KeyToNamespacedKey(ns string, baseKey string) string
- func NewODLMCache(namespaces []string, ...) cache.NewCacheFunc
- type ODLMCache
- func (c ODLMCache) Get(ctx context.Context, key client.ObjectKey, obj runtime.Object) error
- func (c ODLMCache) GetInformer(ctx context.Context, obj runtime.Object) (cache.Informer, error)
- func (c ODLMCache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)
- func (c ODLMCache) IndexField(ctx context.Context, obj runtime.Object, field string, ...) error
- func (c ODLMCache) List(ctx context.Context, list runtime.Object, opts ...client.ListOption) error
- func (c ODLMCache) Start(stopCh <-chan struct{}) error
- func (c ODLMCache) WaitForCacheSync(stop <-chan struct{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FieldIndexName ¶
FieldIndexName constructs the name of the index over the given field, for use with an indexer.
func KeyToNamespacedKey ¶
KeyToNamespacedKey prefixes the given index key with a namespace for use in field selector indexes.
func NewODLMCache ¶
func NewODLMCache(namespaces []string, gvkLabelMap map[schema.GroupVersionKind]filteredcache.Selector) cache.NewCacheFunc
NewODLMCache implements a customized cache with a for ODLM
Types ¶
type ODLMCache ¶
ODLMCache is the customized cache for ODLM
func (ODLMCache) Get ¶
Get implements Reader If the resource is in the cache, Get function get fetch in from the informer Otherwise, resource will be get by the k8s client
func (ODLMCache) GetInformer ¶
GetInformer fetches or constructs an informer for the given object that corresponds to a single API kind and resource.
func (ODLMCache) GetInformerForKind ¶
func (c ODLMCache) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (cache.Informer, error)
GetInformerForKind is similar to GetInformer, except that it takes a group-version-kind, instead of the underlying object.
func (ODLMCache) IndexField ¶
func (c ODLMCache) IndexField(ctx context.Context, obj runtime.Object, field string, extractValue client.IndexerFunc) error
IndexField adds an indexer to the underlying cache, using extraction function to get value(s) from the given field. The filtered cache doesn't support the index yet.
func (ODLMCache) Start ¶
Start runs all the informers known to this cache until the given channel is closed. It blocks.
func (ODLMCache) WaitForCacheSync ¶
WaitForCacheSync waits for all the caches to sync. Returns false if it could not sync a cache.