informer

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(reg prometheus.Registerer)

func SanitizeObject

func SanitizeObject(obj *unstructured.Unstructured)

Types

type EventHandler

type EventHandler interface {
	OnCreate(ctx context.Context, obj *unstructured.Unstructured) error
	OnUpdate(ctx context.Context, obj *unstructured.Unstructured) error
	OnDelete(ctx context.Context, obj *unstructured.Unstructured) error
}

type Informer

type Informer interface {
	Start() error
	Ready() bool
}

type KubeInformer

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

func New

func New(ctx context.Context, gvr schema.GroupVersionResource, k8sClient dynamic.Interface, eventHandler EventHandler) *KubeInformer

func (*KubeInformer) Ready

func (i *KubeInformer) Ready() bool

func (*KubeInformer) Start

func (i *KubeInformer) Start() error

type NoCacheInformer

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

[experimental] NoCacheInformer implements the Informer pattern without keeping a local cache. It flushes events directly to the event handler, which is useful for resources that are too large to store efficiently in memory.

func NewNoCache

func NewNoCache(ctx context.Context, gvr schema.GroupVersionResource, k8sClient dynamic.Interface, eventHandler EventHandler) *NoCacheInformer

[experimental] NewNoCache creates a new informer that does not use a local cache.

func NewNoCacheWithOptions

func NewNoCacheWithOptions(ctx context.Context, gvr schema.GroupVersionResource, k8sClient dynamic.Interface, eventHandler EventHandler, options NoCacheInformerOptions) *NoCacheInformer

[experimental] NewNoCacheWithOptions creates a new informer that does not use a local cache with custom options.

func (*NoCacheInformer) Ready

func (i *NoCacheInformer) Ready() bool

func (*NoCacheInformer) Reload

func (i *NoCacheInformer) Reload() error

func (*NoCacheInformer) Start

func (i *NoCacheInformer) Start() error

func (*NoCacheInformer) Stop

func (i *NoCacheInformer) Stop()

type NoCacheInformerOptions

type NoCacheInformerOptions struct {
	BufferSize           int64
	QueueSize            int
	WorkerCount          int
	ResyncPeriod         time.Duration
	PrometheusRegisterer prometheus.Registerer
}

NoCacheInformerOptions provides configurable options for the NoCacheInformer

func DefaultNoCacheInformerOptions

func DefaultNoCacheInformerOptions() NoCacheInformerOptions

DefaultNoCacheInformerOptions returns the default options for a NoCacheInformer

Jump to

Keyboard shortcuts

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