codestyle: moves cache to infra (#17519)

This commit is contained in:
Carl Bergquist
2019-06-13 10:55:38 +02:00
committed by GitHub
parent df917663e6
commit 6809d2bb29
5 changed files with 14 additions and 12 deletions
+19
View File
@@ -0,0 +1,19 @@
package localcache
import (
"time"
gocache "github.com/patrickmn/go-cache"
)
// CacheService cache any object in memory on the local instance.
type CacheService struct {
*gocache.Cache
}
// New returns a new CacheService
func New(defaultExpiration, cleanupInterval time.Duration) *CacheService {
return &CacheService{
Cache: gocache.New(defaultExpiration, cleanupInterval),
}
}