cache.go 284 B

1234567891011121314151617
  1. package cache
  2. import (
  3. "time"
  4. gocache "github.com/patrickmn/go-cache"
  5. )
  6. type CacheService struct {
  7. *gocache.Cache
  8. }
  9. func New(defaultExpiration, cleanupInterval time.Duration) *CacheService {
  10. return &CacheService{
  11. Cache: gocache.New(defaultExpiration, cleanupInterval),
  12. }
  13. }