sync

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewEventHandler

func NewEventHandler(queue workqueue.Interface, log logr.Logger) cache.ResourceEventHandler

Types

type Controller

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

func NewController

func NewController(
	informer cache.SharedIndexInformer,
	log logr.Logger,
) *Controller

func (*Controller) Announce

func (c *Controller) Announce(obj interface{}) error

func (*Controller) Stream

func (c *Controller) Stream(ctx context.Context, sink *Sink) error

type EventHandler

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

func (*EventHandler) OnAdd

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

func (*EventHandler) OnDelete

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

func (*EventHandler) OnUpdate

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

type Feature

type Feature func(*Features)

func WithNoDelete

func WithNoDelete() Feature

func WithNoWarumup

func WithNoWarumup() Feature

func WithOnDelete

func WithOnDelete(fn com.ProcessBulk[any]) Feature

func WithOnUpsert

func WithOnUpsert(fn com.ProcessBulk[any]) Feature

type Features

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

func NewFeatures

func NewFeatures(features ...Feature) *Features

func (*Features) NoDelete

func (f *Features) NoDelete() bool

func (*Features) NoWarmup

func (f *Features) NoWarmup() bool

func (*Features) OnDelete

func (f *Features) OnDelete() com.ProcessBulk[any]

func (*Features) OnUpsert

func (f *Features) OnUpsert() com.ProcessBulk[any]

type Item

type Item struct {
	Key  string
	Item kmetav1.Object
}

type Sink

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

func NewSink

func NewSink(upsertFunc func(*Item) interface{}, deleteFunc func(interface{}) interface{}) *Sink

func (*Sink) Delete

func (s *Sink) Delete(ctx context.Context, key string) error

func (*Sink) DeleteCh

func (s *Sink) DeleteCh() <-chan interface{}

func (*Sink) Error

func (s *Sink) Error(ctx context.Context, err error) error

func (*Sink) ErrorCh

func (s *Sink) ErrorCh() <-chan error

func (*Sink) Upsert

func (s *Sink) Upsert(ctx context.Context, item *Item) error

func (*Sink) UpsertCh

func (s *Sink) UpsertCh() <-chan interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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