Documentation ¶
Index ¶
- func DefaultEnqueueFunc(obj interface{}) (interface{}, error)
- type Controller
- func (c *Controller) DefaultResourceEventHandlerFuncs() cache.ResourceEventHandlerFuncs
- func (c *Controller) Enqueue(obj interface{})
- func (c *Controller) Run(ctx context.Context)
- func (c *Controller) WithCacheSynced(informersSynced ...cache.InformerSynced) *Controller
- func (c *Controller) WithEnqueueFilterFunc(enqueueFilterFunc EnqueueFilterFunc) *Controller
- func (c *Controller) WithEnqueueFunc(enqueueFunc EnqueueFunc) *Controller
- func (c *Controller) WithHandlerContextFunc(handlerContextFunc HandlerContextFunc) *Controller
- func (c *Controller) WithHandlerFunc(handlerFunc HandlerFunc) *Controller
- func (c *Controller) WithLeaderElection(leaseLock rl.Interface, ...) *Controller
- func (c *Controller) WithQueue(queue workqueue.RateLimitingInterface) *Controller
- func (c *Controller) WithWorkers(workers int) *Controller
- type EnqueueFilterFunc
- type EnqueueFunc
- type HandlerContextFunc
- type HandlerFuncdeprecated
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultEnqueueFunc ¶
func DefaultEnqueueFunc(obj interface{}) (interface{}, error)
DefaultEnqueueFunc uses a default namespacedKey as its KeyFunc. The key uses the format <namespace>/<name> unless <namespace> is empty, then it's just <name>.
Types ¶
type Controller ¶
type Controller struct {
// contains filtered or unexported fields
}
func NewController ¶
func NewController(name string) *Controller
NewController creates a new Controller
func (*Controller) DefaultResourceEventHandlerFuncs ¶ added in v0.2.0
func (c *Controller) DefaultResourceEventHandlerFuncs() cache.ResourceEventHandlerFuncs
func (*Controller) Enqueue ¶
func (c *Controller) Enqueue(obj interface{})
Enqueue takes an object and converts it into a key (could be a string, or a struct) which is then put onto the work queue.
func (*Controller) Run ¶
func (c *Controller) Run(ctx context.Context)
Run will start multiple workers to process work items from work queue. It will block until ctx is closed.
func (*Controller) WithCacheSynced ¶
func (c *Controller) WithCacheSynced(informersSynced ...cache.InformerSynced) *Controller
WithCacheSynced sets all the resource cacheSynced
func (*Controller) WithEnqueueFilterFunc ¶ added in v0.2.0
func (c *Controller) WithEnqueueFilterFunc(enqueueFilterFunc EnqueueFilterFunc) *Controller
WithEnqueueFilterFunc sets customize enqueueFilterFunc
func (*Controller) WithEnqueueFunc ¶
func (c *Controller) WithEnqueueFunc(enqueueFunc EnqueueFunc) *Controller
WithEnqueueFunc sets customize enqueueFunc
func (*Controller) WithHandlerContextFunc ¶ added in v0.8.0
func (c *Controller) WithHandlerContextFunc(handlerContextFunc HandlerContextFunc) *Controller
WithHandlerContextFunc sets a handler function to process the work item off the work queue
func (*Controller) WithHandlerFunc ¶
func (c *Controller) WithHandlerFunc(handlerFunc HandlerFunc) *Controller
WithHandlerFunc sets a handler function to process the work item off the work queue Deprecated: Use WithHandlerContextFunc instead.
func (*Controller) WithLeaderElection ¶
func (c *Controller) WithLeaderElection(leaseLock rl.Interface, leaseDuration, renewDeadline, retryPeriod time.Duration) *Controller
WithLeaderElection uses leader election to get the lock
func (*Controller) WithQueue ¶ added in v0.7.0
func (c *Controller) WithQueue(queue workqueue.RateLimitingInterface) *Controller
WithQueue replaces the default queue with the desired one to store work items.
func (*Controller) WithWorkers ¶
func (c *Controller) WithWorkers(workers int) *Controller
WithWorkers sets the number of workers to process work items off work queue
type EnqueueFilterFunc ¶ added in v0.2.0
type EnqueueFunc ¶
type EnqueueFunc func(obj interface{}) (interface{}, error)
type HandlerContextFunc ¶ added in v0.8.0
type HandlerFunc
deprecated
type Interface ¶
type Interface interface { Enqueue(obj interface{}) WithEnqueueFunc(EnqueueFunc) *Controller // Deprecated: Use WithHandlerContextFunc instead. WithHandlerFunc(HandlerFunc) *Controller WithHandlerContextFunc(HandlerContextFunc) *Controller WithLeaderElection(leaseLock rl.Interface, leaseDuration, renewDeadline, retryPeriod time.Duration) *Controller WithCacheSynced(...cache.InformerSynced) *Controller }
Directories ¶
Path | Synopsis |
---|---|
examples
|
|
downgrading-dependencies
Module
|
|
enqueue-filter-informer
Module
|
|
sample-informer
Module
|
|
use-leader-election
Module
|
|