Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResourceKeyFunc ¶
Types ¶
type Informer ¶
type Informer interface {
// Run starts and runs the shared informer, returning after it stops.
// The informer will be stopped when stopCh is closed.
Run(stopCh <-chan struct{})
// IsStopped reports whether the informer has already been stopped.
// Adding event handlers to already stopped informers is not possible.
// An informer already stopped will never be started again.
IsStopped() bool
// SetTransform The TransformFunc is called for each object which is about to be stored.
//
// This function is intended for you to take the opportunity to
// remove, transform, or normalize fields. One use case is to strip unused
// metadata fields out of objects to save on RAM cost.
//
// Must be set before starting the informer.
//
// Please see the comment on TransformFunc for more details.
SetTransform(handler cache.TransformFunc) error
}
Informer is transferred from cache.SharedInformer, and modified to support event distribution in events.EventBus
func NewInformerWithOptions ¶
func NewInformerWithOptions( lw cache.ListerWatcher, emitter events.Emitter, store store.ResourceStore, keyFunc cache.KeyFunc, options Options) Informer
type Options ¶
type Options struct {
// ResyncPeriod is the default event handler resync period and resync check
// period. If unset/unspecified, these are defaulted to 0 (do not resync).
ResyncPeriod time.Duration
}
Options configures an informer.
type ResourceListerWatcher ¶
type ResourceListerWatcher interface {
cache.ListerWatcher
// ResourceKind returns the kind of resource this listerwatcher is for
ResourceKind() coremodel.ResourceKind
// TransformFunc transform the raw resource into your need before the raw resource pushing into the delta fifo,
// return nil if there is no need to transform, see cache.SharedInformer for detail
TransformFunc() cache.TransformFunc
}
Click to show internal directories.
Click to hide internal directories.