Help us shape the future of Go! Take the 2026 Go Developer Survey

handler

package
v1.23.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2025 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRDEventHandler

type CRDEventHandler struct {
	Mapping resourceMap
	Channel chan event.GenericEvent
	Log     logr.Logger
}

CRDEventHandler pushes an event to ResourceGroup event channel when the CRD or its CRs are contained in some ResourceGroup CRs.

func (*CRDEventHandler) Create

Create implements EventHandler

func (*CRDEventHandler) Delete

Delete implements EventHandler

func (*CRDEventHandler) Generic

Generic implements EventHandler

func (*CRDEventHandler) Update

Update implements EventHandler

type EnqueueEventToChannel

type EnqueueEventToChannel struct {
	Mapping resourceMap
	Channel chan event.GenericEvent
	Log     logr.Logger
	GVK     schema.GroupVersionKind
}

EnqueueEventToChannel pushes an event to ResourceGroup event channel instead of enqueue a Reqeust for ResourceGroup.

func (*EnqueueEventToChannel) OnAdd

func (e *EnqueueEventToChannel) OnAdd(obj interface{}, _ bool)

OnAdd implements EventHandler

func (*EnqueueEventToChannel) OnDelete

func (e *EnqueueEventToChannel) OnDelete(obj interface{})

OnDelete implements EventHandler

func (*EnqueueEventToChannel) OnUpdate

func (e *EnqueueEventToChannel) OnUpdate(_, newObj interface{})

OnUpdate implements EventHandler

type Throttler

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

Throttler only pushes a request to ResourceGroup work queue when there is no same event in the queue. It works with only GenericEvent and no-op for other events.

func NewThrottler

func NewThrottler(d time.Duration) *Throttler

NewThrottler returns an instance of Throttler

func (*Throttler) Create

Create implements EventHandler. All create events are ignored.

func (*Throttler) Delete

Delete implements EventHandler. All delete events are ignored.

func (*Throttler) Generic

Generic implements EventHandler. It pushes at most one event for the same object to the queue during duration.

func (*Throttler) Update

Update implements EventHandler. All update events are ignored.

Jump to

Keyboard shortcuts

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