event

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

the code is almost from https://github.com/resmoio/kubernetes-event-exporter/blob/master/pkg/kube/watcher.go but we need to change the event.OnUpdate() function to make it work

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEventExporter

func AddEventExporter(mgr ctrl.Manager, eventConfigFile string, leafHubName string) error

Types

type EventEnhancer

type EventEnhancer interface {
	// Enhance is used to modify the event before it is omitted by the exporter
	Enhance(ctx context.Context, event *kube.EnhancedEvent)
}

type EventExporter

type EventExporter interface {
	// Start starts the event exporter and make sure it can be added to the manager
	Start(ctx context.Context) error
	// RegisterEnhancer registers an event enhancer
	RegisterEnhancer(enhancer EventEnhancer)
}

type EventHandler

type EventHandler func(event *kube.EnhancedEvent)

type EventWatcher

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

func NewEventWatcher

func NewEventWatcher(config *rest.Config, namespace string, MaxEventAgeSeconds int64,
	metricsStore *metrics.Store, fn EventHandler,
) *EventWatcher

func NewMockEventWatcher

func NewMockEventWatcher(MaxEventAgeSeconds int64, metricsStore *metrics.Store) *EventWatcher

func (*EventWatcher) OnAdd

func (e *EventWatcher) OnAdd(obj interface{})

func (*EventWatcher) OnDelete

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

func (*EventWatcher) OnUpdate

func (e *EventWatcher) OnUpdate(oldObj, newObj interface{})

func (*EventWatcher) Start

func (e *EventWatcher) Start()

func (*EventWatcher) Stop

func (e *EventWatcher) Stop()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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