Documentation ¶
Index ¶
Constants ¶
View Source
const ConfigMapKey = "data"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppLogic ¶
type AppLogic[T1 client.Object] interface { Get(ctx context.Context, a T1) (T1, error) Validate(ctx context.Context, a T1) (string, error) Apply(ctx context.Context, a T1) (T1, error) Delete(ctx context.Context, a T1) error }
func NewApplogic ¶
func NewApplogic[T1 client.Object](cfg *ApplogicConfig[T1]) (AppLogic[T1], error)
type ApplogicConfig ¶
type ApplogicConfig[T1 client.Object] struct { GetHandler GetHandler[T1] ValidateHandler ValidateHandler[T1] ApplyHandler ApplyHandler[T1] DeleteHandler DeleteHandler[T1] }
type Backend ¶
type Backend interface { // CreateIndex creates a backend index CreateIndex(ctx context.Context, cr []byte) error // DeleteIndex deletes a backend index DeleteIndex(ctx context.Context, cr []byte) error // List the data from the backend index List(ctx context.Context, cr []byte) (any, error) // Add a dynamic watch with callback to the backend index AddWatch(ownerGvkKey, ownerGvk string, fn CallbackFn) // Delete a dynamic watch with callback deom the backend index DeleteWatch(ownerGvkKey, ownerGvk string) //GetClaim return the claim if it exists GetClaim(ctx context.Context, cr []byte) ([]byte, error) // Claim claims an entry in the backend index Claim(ctx context.Context, cr []byte) ([]byte, error) // DeleteClaim delete a claim in the backend index DeleteClaim(ctx context.Context, cr []byte) error }
type CMConfig ¶
type CMConfig struct { Client client.Client GetData GetDataFn RestoreData RestoreDataFn Prefix string }
type Cache ¶
type Cache[T1 any] interface { IsInitialized(corev1.ObjectReference) bool SetInitialized(corev1.ObjectReference) error Get(corev1.ObjectReference, bool) (T1, error) Create(corev1.ObjectReference, T1) Delete(corev1.ObjectReference) }
type CallbackFn ¶
type CallbackFn func(table.Routes, resourcepb.StatusCode)
type RestoreDataFn ¶
type Storage ¶
type Storage[T1, T2 any] interface { Restore(ctx context.Context, ref corev1.ObjectReference) error // only used in configmap SaveAll(ctx context.Context, ref corev1.ObjectReference) error // Destroy removes the store db Destroy(ctx context.Context, ref corev1.ObjectReference) error Get(ctx context.Context, claim T1) ([]T2, error) Set(ctx context.Context, claim T1) error Delete(ctx context.Context, claim T1) error }
func NewCMBackend ¶
func NewNopStorage ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.