backend

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

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 backend.IndexObject) context.Context

func NewClaimPreparator

func NewClaimPreparator(be Backend) registry.APIPrepator

func NewIndexPreparator

func NewIndexPreparator(be Backend) registry.APIPrepator

Types

type Backend

type Backend interface {
	AddStorage(entryStorage, claimStorage rest.Storage)
	// CreateIndex creates a backend index
	CreateIndex(ctx context.Context, obj runtime.Unstructured) error
	// DeleteIndex deletes a backend index
	DeleteIndex(ctx context.Context, obj runtime.Unstructured) error
	// Claim claims an entry in the backend index
	Claim(ctx context.Context, obj runtime.Unstructured) error
	// Release a claim in the backend
	Release(ctx context.Context, obj runtime.Unstructured) error
}

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]

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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