INNER CODE UNIT · Go

cacheKeyFunc

kubernetes-csi/csi-driver-nfs · pkg/nfs/cache.go:54

func cacheKeyFunc(obj interface{}) (string, error) {
	return obj.(*CacheEntry).Key, nil
}

// Resource operations
// Note: This interface only includes the methods actually used by the NFS CSI driver.
// The original Azure cache had additional methods (GetWithDeepCopy, Delete, Update,
// GetStore, Lock, Unlock) that are not used in this codebase and thus not implemented.
type Resource interface {
	Get(key string, crt CacheReadType) (interface{}, error)
	Set(key string, data interface{})
}

// TimedCache is a cache with TTL.
type TimedCache struct {
	Store     cache.Store
	MutexLock sync.RWMutex
	TTL       time.Duration

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…