mirror of
https://github.com/grafana/grafana.git
synced 2026-07-29 15:59:50 -05:00
codestyle: moves cache to infra (#17519)
This commit is contained in:
@@ -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),
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user