refactor datasource caching

This commit is contained in:
Marcus Efraimsson
2018-10-26 10:40:33 +02:00
parent 1dc8b898bb
commit cfb061ddab
9 changed files with 109 additions and 55 deletions

17
pkg/services/cache/cache.go vendored Normal file
View File

@@ -0,0 +1,17 @@
package cache
import (
"time"
gocache "github.com/patrickmn/go-cache"
)
type CacheService struct {
*gocache.Cache
}
func New(defaultExpiration, cleanupInterval time.Duration) *CacheService {
return &CacheService{
Cache: gocache.New(defaultExpiration, cleanupInterval),
}
}