type ObjectCache … type objectEntry … // NewObjectCache creates ObjectCache with an updater. // updater returns an object to cache. func NewObjectCache(f func() (interface{ … } // stringKeyFunc is a string as cache key function func stringKeyFunc(obj interface{ … } // Get gets cached objectEntry by using a unique string as the key. func (c *ObjectCache) Get(key string) (interface{ … } // Add adds objectEntry by using a unique string as the key. func (c *ObjectCache) Add(key string, obj interface{ … }