Documentation ¶
Overview ¶
Package cache defines resource group aware Cache.
The Cache implements sync loop and garbage collector inspired from the ones existing in Kubernetes, but in this case only finalizers are respected while currently there is not a concept of ownerReferences.
Note: The cloud runtime is using a Cache for all the resource groups, so it will be possible to implement controllers processing request from all the resources groups.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Start(ctx context.Context) error AddResourceGroup(name string) DeleteResourceGroup(name string) Get(resourceGroup string, key client.ObjectKey, obj client.Object) error List(resourceGroup string, list client.ObjectList, opts ...client.ListOption) error Create(resourceGroup string, obj client.Object) error Delete(resourceGroup string, obj client.Object) error Update(resourceGroup string, obj client.Object) error Patch(resourceGroup string, obj client.Object, patch client.Patch) error GetInformer(ctx context.Context, obj client.Object) (Informer, error) GetInformerForKind(ctx context.Context, gvk schema.GroupVersionKind) (Informer, error) }
Cache implements an in-memory cache. TODO: consider if to move to internal.
type InformEventHandler ¶
type InformEventHandler interface { OnCreate(resourceGroup string, obj client.Object) OnUpdate(resourceGroup string, oldObj, newObj client.Object) OnDelete(resourceGroup string, obj client.Object) OnGeneric(resourceGroup string, obj client.Object) }
InformEventHandler handle events originated by a source.
type Informer ¶
type Informer interface {
AddEventHandler(handler InformEventHandler) error
}
Informer forwards events to event handlers.
Click to show internal directories.
Click to hide internal directories.