cache.go 342 B

12345678910111213141516171819
  1. package cache
  2. //return status of chache
  3. type CacheStatus struct {
  4. Gets int64
  5. Hits int64
  6. MaxItemSize int
  7. CurrentSize int
  8. }
  9. //this is a interface which defines some common functions
  10. type Cache interface{
  11. Set(key string, value interface{})
  12. Get(key string) (interface{}, bool)
  13. Delete(key string)
  14. Status()(*CacheStatus)
  15. }