store

package
v1.15.4 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrStoreUninitialized = errors.New("the store has not initialized yet")

Functions

func NewFakeDiffStore

func NewFakeDiffStore[T runtime.Object]() *fakeDiffStore[T]

func NewMockBGPCPResourceStore

func NewMockBGPCPResourceStore[T runtime.Object]() *mockBGPCPResourceStore[T]

Types

type BGPCPResourceStore

type BGPCPResourceStore[T k8sRuntime.Object] interface {
	// GetByKey returns the latest version of the object with given key.
	GetByKey(key resource.Key) (item T, exists bool, err error)

	// List returns all items currently in the store.
	List() (items []T, err error)
}

BGPCPResourceStore is a wrapper around the resource.Store for the BGP Control Plane reconcilers usage. It automatically signals the BGP Control Plane whenever an event happens on the resource.

func NewBGPCPResourceStore

func NewBGPCPResourceStore[T k8sRuntime.Object](params bgpCPResourceStoreParams[T]) BGPCPResourceStore[T]

type DiffStore

type DiffStore[T k8sRuntime.Object] interface {
	// Diff returns a list of items that have been upserted(updated or inserted) and deleted since the last call to Diff.
	Diff() (upserted []T, deleted []resource.Key, err error)

	// GetByKey returns the latest version of the object with given key.
	GetByKey(key resource.Key) (item T, exists bool, err error)

	// List returns all items currently in the store.
	List() (items []T, err error)
}

DiffStore is a wrapper around the resource.Store. The diffStore tracks all changes made to it since the last time the user synced up. This allows a user to get a list of just the changed objects while still being able to query the full store for a full sync.

func NewDiffStore

func NewDiffStore[T k8sRuntime.Object](params diffStoreParams[T]) DiffStore[T]

Jump to

Keyboard shortcuts

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