inmemory

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: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSortableOrDie

func NewSortableOrDie[T store.Object](ctx context.Context, storeOpts StoreOpts) store.ObjectStore[T]

func Sortable

func Sortable[T store.Object](ios *InmemoryObjectStore[T], storeOpts StoreOpts) store.ObjectStore[T]

Types

type DatabaseOpts

type DatabaseOpts struct {
	// Filepath will store the badger database on disk at the given filepath.
	Filepath     string
	ReduceMemory bool
}

type InformerOpts

type InformerOpts struct {
	DisableCache bool
}

type InmemoryObjectStore

type InmemoryObjectStore[T store.Object] struct {
	// contains filtered or unexported fields
}

func NewOrDie

func NewOrDie[T store.Object](ctx context.Context, storeOpts StoreOpts) *InmemoryObjectStore[T]

func (*InmemoryObjectStore[T]) CreateOrReplace

func (s *InmemoryObjectStore[T]) CreateOrReplace(ctx context.Context, in T) error

CreateOrReplace creates or replaces the given object in the store. It will use the Kubernetes API to create or update the object and store the result in this store. It does not update the object in-place To get the latest version of the object, use Get after CreateOrReplace.

func (*InmemoryObjectStore[T]) Delete

func (s *InmemoryObjectStore[T]) Delete(ctx context.Context, namespace, name string) error

func (*InmemoryObjectStore[T]) Get

func (s *InmemoryObjectStore[T]) Get(ctx context.Context, namespace, name string) (result T, err error)

func (*InmemoryObjectStore[T]) Info

func (*InmemoryObjectStore[T]) List

func (s *InmemoryObjectStore[T]) List(ctx context.Context, listOpts store.ListOpts) (result *store.ListResponse[T], err error)

func (*InmemoryObjectStore[T]) OnCreate

func (*InmemoryObjectStore[T]) OnDelete

func (*InmemoryObjectStore[T]) OnUpdate

func (*InmemoryObjectStore[T]) Patch

func (s *InmemoryObjectStore[T]) Patch(ctx context.Context, namespace, name string, ops ...store.Patch) (obj T, err error)

func (*InmemoryObjectStore[T]) Ready

func (s *InmemoryObjectStore[T]) Ready() bool

type LoggerShim

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

func NewLoggerShim

func NewLoggerShim(log logr.Logger) *LoggerShim

func (*LoggerShim) Debugf

func (l *LoggerShim) Debugf(format string, args ...interface{})

func (*LoggerShim) Errorf

func (l *LoggerShim) Errorf(format string, args ...interface{})

func (*LoggerShim) Infof

func (l *LoggerShim) Infof(format string, args ...interface{})

func (*LoggerShim) Warningf

func (l *LoggerShim) Warningf(format string, args ...interface{})

type SortableStore

type SortableStore[T store.Object] struct {
	*InmemoryObjectStore[T]
	// contains filtered or unexported fields
}

func (*SortableStore[T]) List

func (s *SortableStore[T]) List(ctx context.Context, listOpts store.ListOpts) (*store.ListResponse[T], error)

type StoreOpts

type StoreOpts struct {
	Client       dynamic.Interface
	GVR          schema.GroupVersionResource
	GVK          schema.GroupVersionKind
	AllowedSorts []string

	Database DatabaseOpts
	Informer InformerOpts

	// DisableRetryOnConflict disables retrying on conflict errors during updates.
	// By default, retries are enabled.
	DisableRetryOnConflict bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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