controller

package
v0.0.0-...-4a3d265 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Work

func Work(shutdown context.Context, controller Interface)

Work represents a worker function that pulls item(s) off of the underlying work queue and invokes the reconciler function associated with the controller.

Types

type EventHandler

type EventHandler struct {
	// contains filtered or unexported fields
}

func NewEventHandler

func NewEventHandler(queue workqueue.RateLimitingInterface) EventHandler

NewEventHandler returns a cache.ResourceEventHandler appropriate for reconciliation of ClusterResourceOverride object(s).

func (EventHandler) OnAdd

func (e EventHandler) OnAdd(obj interface{}, isInInitialList bool)

func (EventHandler) OnDelete

func (e EventHandler) OnDelete(obj interface{})

func (EventHandler) OnUpdate

func (e EventHandler) OnUpdate(oldObj, newObj interface{})

OnUpdate creates UpdateEvent and calls Update on EventHandler

type Interface

type Interface interface {
	// Name returns the name of the controller.
	Name() string

	// WorkerCount returns the number of worker(s) that will process item(s)
	// off of the underlying work queue.s
	WorkerCount() int

	//Queue returns the underlying work queue associated with the controller.
	Queue() workqueue.RateLimitingInterface

	// Informer returns the underlying Informer object associated with the controller.
	Informer() cache.Controller

	// Reconciler returns the reconciler function that reconciles a request from a work queue.
	Reconciler() reconcile.Reconciler
}

Interface defines a controller.

type Runner

type Runner interface {
	// Run initializes the given controller and starts it. It waits until the shutdown
	// context is done.
	// The function should return on any error during initialization.
	// Any error encountered during initialization is written to the errorCh channel so
	// that the caller take appropriate action.
	Run(shutdown context.Context, controller Interface, errorCh chan<- error)

	// Done returns a channel that's closed when the Run function finishes.
	Done() <-chan struct{}
}

Runner sets up a controller.

func NewRunner

func NewRunner() Runner

NewRunner returns a new instance of Runner.

type WorkerFunc

type WorkerFunc func(shutdown context.Context, controller Interface)

func (WorkerFunc) Work

func (w WorkerFunc) Work(shutdown context.Context, controller Interface)

Jump to

Keyboard shortcuts

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