Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MutationCache ¶
type MutationCache interface { GetByKey(key string) (interface{}, bool, error) ByIndex(indexName, indexKey string) ([]interface{}, error) Mutation(interface{}) }
MutationCache is able to take the result of update operations and stores them in an LRU that can be used to provide a more current view of a requested object. It requires interpreting resourceVersions for comparisons. Implementations must be thread-safe. TODO find a way to layer this into an informer/lister
func NewIntegerResourceVersionMutationCache ¶
func NewIntegerResourceVersionMutationCache(keyFunc cache.KeyFunc, backingCache cache.Store, indexer cache.Indexer, ttl time.Duration, includeAdds bool) MutationCache
NewIntegerResourceVersionMutationCache returns a MutationCache that understands how to deal with objects that have a resource version that:
- is an integer
- increases when updated
- is comparable across the same resource in a namespace
Most backends will have these semantics. Indexer may be nil. ttl controls how long an item remains in the mutation cache before it is removed.
If includeAdds is true, objects in the mutation cache will be returned even if they don't exist in the underlying store. This is only safe if your use of the cache can handle mutation entries remaining in the cache for up to ttl when mutations and deletes occur very closely in time.
type ResourceVersionComparator ¶
ResourceVersionComparator is able to compare object versions.