Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CachingRecommender ¶
type CachingRecommender interface { // Get returns VPA recommendation for given pod Get(spec *apiv1.PodSpec) (*apimock.Recommendation, error) }
CachingRecommender provides VPA recommendations for pods. VPA responses are cashed
func NewCachingRecommender ¶
func NewCachingRecommender(ttl time.Duration, api apimock.RecommenderAPI) CachingRecommender
NewCachingRecommender creates CachingRecommender with given cache TTL
type TTLCache ¶
type TTLCache struct {
// contains filtered or unexported fields
}
TTLCache represents cache with ttl
func NewTTLCache ¶
NewTTLCache reates TTLCache for given TTL
func (*TTLCache) Get ¶
Get Returns value present in cache for given cache key, or nil if key is not found or value TTL has expired.
func (*TTLCache) StartCacheGC ¶
StartCacheGC starts background garbage collector worker which on every time interval removes expired cache entries If StartCacheGC was called, in order to properly remove cache object, call StopCacheGC. Otherwise TTLCache will never be garbage collected since background worker holds reference to it.
func (*TTLCache) StopCacheGC ¶
func (c *TTLCache) StopCacheGC()
StopCacheGC stops background cache garbage collector