backend

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: Apache-2.0 Imports: 14 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitClaimContext

func InitClaimContext(ctx context.Context, op string, claim backend.ClaimObject) context.Context

func InitIndexContext

func InitIndexContext(ctx context.Context, op string, idx client.Object) context.Context

func NewClaimInvoker

func NewClaimInvoker(be Backend) options.BackendInvoker

func NewIndexInvoker

func NewIndexInvoker(be Backend) options.BackendInvoker

Types

type Backend

type Backend interface {
	// AddStorageInterfaces
	AddStorageInterfaces(bestorage any) error
	// CreateIndex creates a backend index
	CreateIndex(ctx context.Context, obj runtime.Object) error
	// DeleteIndex deletes a backend index
	DeleteIndex(ctx context.Context, obj runtime.Object) error
	// Claim claims an entry in the backend index
	Claim(ctx context.Context, obj runtime.Object, recursion bool) error
	// Release a claim in the backend
	Release(ctx context.Context, obj runtime.Object, recursion bool) error
	// PrintEntries prints the entries of the cache
	PrintEntries(ctx context.Context, index string)
}

type BackendConfig

type BackendConfig struct {
	Backend   Backend
	IndexKind string
	EntryKind string
	ClaimKind string
}

type Cache

type Cache[T1 any] interface {
	IsInitialized(ctx context.Context, k store.Key) bool
	SetInitialized(ctx context.Context, k store.Key) error
	Get(ctx context.Context, k store.Key) (T1, error)
	Create(ctx context.Context, k store.Key, i T1)
	Delete(ctx context.Context, k store.Key)
}

func NewCache

func NewCache[T1 any]() Cache[T1]

type StorageProviders

type StorageProviders[T1 any] interface {
	GetIndexStorageProvider() *rest.StorageProvider
	GetClaimStorageProvider() *rest.StorageProvider
	GetEntryStorageProvider() *rest.StorageProvider
	ApplyStorageToBackend(ctx context.Context, apiServer *builder.Server) error
	GetBackend() Backend
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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