Documentation
¶
Index ¶
- func NewTransformingWatcher(watcher watch.Interface, eventTransformer EventTransformer) *transformingWatcher
- func WithResourceTransformer(clusterClient kcpdynamic.ClusterInterface, transformer ResourceTransformer) kcpdynamic.ClusterInterface
- type EventTransformer
- type ResourceInterfaceWithResults
- type ResourceTransformer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTransformingWatcher ¶
func NewTransformingWatcher(watcher watch.Interface, eventTransformer EventTransformer) *transformingWatcher
NewTransformingWatcher returns a watcher based on the input watcher, but which will apply the EventTransformer to each event before delivering it.
func WithResourceTransformer ¶
func WithResourceTransformer(clusterClient kcpdynamic.ClusterInterface, transformer ResourceTransformer) kcpdynamic.ClusterInterface
WithResourceTransformer returns a ClusterInterface client whose kubernetes clients are wired with a ResourceTransformer.
Types ¶
type EventTransformer ¶
EventTransformer is a simple interface that transforms a watch event.
type ResourceInterfaceWithResults ¶
type ResourceInterfaceWithResults interface { dynamic.ResourceInterface clientdynamic.DeleterWithResults }
type ResourceTransformer ¶
type ResourceTransformer interface { // BeforeWrite is called before a resource is created or updated. The resource effectively created or updated // sent to the kubernetes client is the transformed resource returned as result of this method call. BeforeWrite(client dynamic.ResourceInterface, ctx context.Context, gvr schema.GroupVersionResource, resource *unstructured.Unstructured, subresources ...string) (transformed *unstructured.Unstructured, err error) // AfterRead is called after a resource is returned from a kubernetes client call. // This includes Get and List calls, but also Create, and Update (since they return the created or updated resource). // It is also called for every resource associated to Watch Events in a Watch call. // In all those cases, the resource effectively read is the transformed resource returned as result of this method call. AfterRead(client dynamic.ResourceInterface, ctx context.Context, gvr schema.GroupVersionResource, resource *unstructured.Unstructured, eventType *watch.EventType, subresources ...string) (transformed *unstructured.Unstructured, err error) }
ResourceTransformer define transformations that should be applied to a resource before and after a client submits a resource request to a kubernetes client.
Click to show internal directories.
Click to hide internal directories.