Documentation ¶
Index ¶
- func SwapMapReplace[K comparable, V any, U any](m *SwapMap[K, V], values map[K]U, transformValue func(U) V) map[K]SwapResult[V]
- type Decayed
- type DecayingInformer
- func (di *DecayingInformer[V]) Add(obj any) error
- func (di *DecayingInformer[V]) Delete(obj any) error
- func (di *DecayingInformer[V]) Get(obj any) (any, bool, error)
- func (di *DecayingInformer[V]) GetByKey(key string) (any, bool, error)
- func (di *DecayingInformer[V]) List() []any
- func (di *DecayingInformer[V]) ListKeys() []string
- func (di *DecayingInformer[V]) Replace(list []any, resourceVersion string) error
- func (di *DecayingInformer[V]) Resync() error
- func (di *DecayingInformer[V]) SetAddCh() <-chan V
- func (di *DecayingInformer[V]) SetRemoveCh() <-chan *Decayed
- func (di *DecayingInformer[V]) SetReplaceCh() <-chan V
- func (di *DecayingInformer[V]) Update(obj any) error
- type ObjectKey
- type PrepushUndeltaStore
- func (store *PrepushUndeltaStore[V]) Add(obj any) error
- func (store *PrepushUndeltaStore[V]) Delete(obj any) error
- func (store *PrepushUndeltaStore[V]) Get(obj any) (any, bool, error)
- func (store *PrepushUndeltaStore[V]) GetByKey(key string) (any, bool, error)
- func (store *PrepushUndeltaStore[V]) List() []any
- func (store *PrepushUndeltaStore[V]) ListKeys() []string
- func (store *PrepushUndeltaStore[V]) Replace(list []any, resourceVersion string) error
- func (store *PrepushUndeltaStore[V]) Resync() error
- func (store *PrepushUndeltaStore[V]) Update(obj any) error
- type SwapMap
- type SwapResult
- type SwapResultKind
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SwapMapReplace ¶
func SwapMapReplace[K comparable, V any, U any](m *SwapMap[K, V], values map[K]U, transformValue func(U) V) map[K]SwapResult[V]
Types ¶
type DecayingInformer ¶
DecayingInformer is an informer that only supports delta handling. It still handles Replace logic (i.e. relisting) properly, but the reference to the object (other than the metadata) is released once the handler is called.
func NewDecayingInformer ¶
func NewDecayingInformer[V metav1.Object]() *DecayingInformer[V]
func (*DecayingInformer[V]) Add ¶
func (di *DecayingInformer[V]) Add(obj any) error
func (*DecayingInformer[V]) Delete ¶
func (di *DecayingInformer[V]) Delete(obj any) error
func (*DecayingInformer[V]) GetByKey ¶
func (di *DecayingInformer[V]) GetByKey(key string) (any, bool, error)
func (*DecayingInformer[V]) List ¶
func (di *DecayingInformer[V]) List() []any
func (*DecayingInformer[V]) ListKeys ¶
func (di *DecayingInformer[V]) ListKeys() []string
func (*DecayingInformer[V]) Replace ¶
func (di *DecayingInformer[V]) Replace(list []any, resourceVersion string) error
func (*DecayingInformer[V]) Resync ¶
func (di *DecayingInformer[V]) Resync() error
func (*DecayingInformer[V]) SetAddCh ¶
func (di *DecayingInformer[V]) SetAddCh() <-chan V
func (*DecayingInformer[V]) SetRemoveCh ¶
func (di *DecayingInformer[V]) SetRemoveCh() <-chan *Decayed
func (*DecayingInformer[V]) SetReplaceCh ¶
func (di *DecayingInformer[V]) SetReplaceCh() <-chan V
func (*DecayingInformer[V]) Update ¶
func (di *DecayingInformer[V]) Update(obj any) error
type ObjectKey ¶
func ObjectKeyOf ¶
type PrepushUndeltaStore ¶
type PrepushUndeltaStore[V metav1.Object] struct { OnAdd func(newObj V) OnUpdate func(oldObj, newObj V) OnDelete func(oldObj V) OnPostReplace func() // contains filtered or unexported fields }
func NewPrepushUndeltaStore ¶
func NewPrepushUndeltaStore[V metav1.Object]( logger logrus.FieldLogger, objectFilter func(obj V) bool, ) *PrepushUndeltaStore[V]
func (*PrepushUndeltaStore[V]) Add ¶
func (store *PrepushUndeltaStore[V]) Add(obj any) error
func (*PrepushUndeltaStore[V]) Delete ¶
func (store *PrepushUndeltaStore[V]) Delete(obj any) error
func (*PrepushUndeltaStore[V]) Get ¶
func (store *PrepushUndeltaStore[V]) Get(obj any) (any, bool, error)
func (*PrepushUndeltaStore[V]) GetByKey ¶
func (store *PrepushUndeltaStore[V]) GetByKey(key string) (any, bool, error)
func (*PrepushUndeltaStore[V]) List ¶
func (store *PrepushUndeltaStore[V]) List() []any
func (*PrepushUndeltaStore[V]) ListKeys ¶
func (store *PrepushUndeltaStore[V]) ListKeys() []string
func (*PrepushUndeltaStore[V]) Replace ¶
func (store *PrepushUndeltaStore[V]) Replace(list []any, resourceVersion string) error
func (*PrepushUndeltaStore[V]) Resync ¶
func (store *PrepushUndeltaStore[V]) Resync() error
func (*PrepushUndeltaStore[V]) Update ¶
func (store *PrepushUndeltaStore[V]) Update(obj any) error
type SwapMap ¶
type SwapMap[K comparable, V any] struct { // contains filtered or unexported fields }
SwapMap is a thread-safe map that provides atomic swapping results, optimized to be used as an informer backend with no read operations.
func NewSwapMap ¶
func NewSwapMap[K comparable, V any](capacity int) *SwapMap[K, V]
func (*SwapMap[K, V]) Swap ¶
func (m *SwapMap[K, V]) Swap(key K, newValue V, hasNewValue bool) SwapResult[V]
type SwapResult ¶
type SwapResult[V any] struct { Kind SwapResultKind // OldValue is the original value if Kind is Remove or Replace OldValue V // NewValue is the new value if Kind is Add or Replace NewValue V }
type SwapResultKind ¶
type SwapResultKind uint8
const ( SwapResultKindNoop SwapResultKind = iota SwapResultKindAdd SwapResultKindRemove SwapResultKindReplace )
Click to show internal directories.
Click to hide internal directories.