Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Key ¶
type Key struct {
types.NamespacedName
}
func KeyFromNSN ¶
func KeyFromNSN(nsn types.NamespacedName) Key
KeyFromNSN takes a types.NamespacedName and returns it wrapped in the Key struct.
type Storer ¶
type Storer[T1 any] interface { // Retrieve retrieves data for the given key from the storage Get(ctx context.Context, key Key) (T1, error) // Retrieve retrieves data for the given key from the storage List(ctx context.Context, visitorFunc func(context.Context, Key, T1)) // Retrieve retrieves data for the given key from the storage ListKeys(ctx context.Context) []string // Len returns the # entries in the store Len(ctx context.Context) int // Create data with the given key in the storage Create(ctx context.Context, key Key, data T1) error // Update data with the given key in the storage Update(ctx context.Context, key Key, data T1) error // Update data in a concurrent way through a function UpdateWithKeyFn(ctx context.Context, key Key, updateFunc func(ctx context.Context, obj T1) T1) // Delete deletes data and key from the storage Delete(ctx context.Context, key Key) error // Watch watches change Watch(ctx context.Context) (watch.Interface[T1], error) }
Storer defines the interface for a generic storage system.
Click to show internal directories.
Click to hide internal directories.