Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultEventBufferCap = 128 // DefaultMaxEventAge is the default maximum age of an event to be considered // for writing to the buffer. This applies only during the initial cache sync. DefaultMaxEventAge = 1 * time.Minute )
Variables ¶
View Source
var CreateKubeClient = func(config *rest.Config) kubernetes.Interface { return kubernetes.NewForConfigOrDie(config) }
Functions ¶
This section is empty.
Types ¶
type EventBuffer ¶
type EventBuffer = circular.RingBuffer[*kube.EnhancedEvent]
func NewEventBuffer ¶
func NewEventBuffer(capacity int) *EventBuffer
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
func (*EventHandler) OnAdd ¶
func (eh *EventHandler) OnAdd(obj interface{}, isInInitialList bool)
func (*EventHandler) OnDelete ¶
func (eh *EventHandler) OnDelete(_ interface{})
func (*EventHandler) OnUpdate ¶
func (eh *EventHandler) OnUpdate(oldObj, newObj interface{})
func (*EventHandler) WriteToBuffer ¶
func (eh *EventHandler) WriteToBuffer(event *corev1.Event)
type Option ¶
type Option func(*Watcher)
func WithLogger ¶
WithLogger sets the logger for the watcher.
func WithMaxEventAge ¶
WithMaxEventAge sets the maximum age of an event to be considered for writing to the buffer. This applies only during the initial cache sync.
func WriteTo ¶
func WriteTo(output *EventBuffer) Option
WriteTo sets the buffer where the watcher writes the observed events.
Click to show internal directories.
Click to hide internal directories.