public interface SharedInformer<ApiType extends io.kubernetes.client.common.KubernetesObject>
| Modifier and Type | Method and Description |
|---|---|
void |
addEventHandler(ResourceEventHandler<ApiType> handler)
Add event handler.
|
void |
addEventHandlerWithResyncPeriod(ResourceEventHandler<ApiType> handler,
long resyncPeriod)
addEventHandlerWithResyncPeriod adds an event handler to the shared informer using the
specified resync period.
|
boolean |
hasSynced()
hasSynced returns true if the shared informer's store has synced.
|
String |
lastSyncResourceVersion()
Last sync resource version string.
|
void |
run()
run starts the shared informer, which will be stopped until stop() is called.
|
void |
setTransform(TransformFunc transformFunc)
The TransformFunc is called for each object which is about to be stored.
|
void |
stop()
stop stops the shared informer.
|
void addEventHandler(ResourceEventHandler<ApiType> handler)
handler - the handlervoid addEventHandlerWithResyncPeriod(ResourceEventHandler<ApiType> handler, long resyncPeriod)
handler - the event handlerresyncPeriod - the specific resync periodvoid run()
void stop()
boolean hasSynced()
String lastSyncResourceVersion()
void setTransform(TransformFunc transformFunc)
Must be set before starting the informer.
Note: Since the object given to the handler may be already shared with other goroutines, it is advisable to copy the object being transform before mutating it at all and returning the copy to prevent data races.
transformFunc - the transform functionCopyright © 2022. All rights reserved.