controller

package
v0.0.0-...-b809b14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResourceKeyFunc

func ResourceKeyFunc(obj interface{}) (string, error)

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL