Documentation ¶
Overview ¶
Package cache implements some cache utils.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewReconcileEntryKey ¶
NewReconcileEntryKey returns the key of a ReconcileEntry based on an object.
Types ¶
type Cache ¶
type Cache[E Entry] interface { // Add adds the given entry to the Cache. // Note: entries expire after the ttl. Add(entry E) // Has checks if the given key (still) exists in the Cache. // Note: entries expire after the ttl. Has(key string) (E, bool) }
Cache caches objects of type Entry.
type Entry ¶
type Entry interface { // Key returns the cache key of an Entry. Key() string }
Entry is the interface for the type of Cache entries.
type ReconcileEntry ¶
ReconcileEntry is an Entry for the Cache that stores the earliest time after which the next Reconcile should be executed.
func NewReconcileEntry ¶
func NewReconcileEntry(obj metav1.Object, reconcileAfter time.Time) ReconcileEntry
NewReconcileEntry creates a new ReconcileEntry based on an object and a reconcileAfter time.
func (ReconcileEntry) Key ¶
func (r ReconcileEntry) Key() string
Key returns the cache key of a ReconcileEntry.
func (ReconcileEntry) ShouldRequeue ¶
ShouldRequeue returns if the current Reconcile should be requeued.
Click to show internal directories.
Click to hide internal directories.