store_interface.go 423 B

123456789101112131415161718192021222324
  1. // Package cache 系统缓存包
  2. package cache
  3. import (
  4. "time"
  5. )
  6. type Store interface {
  7. Set(key, value string, expire time.Duration)
  8. Get(key string) string
  9. Has(key string) bool
  10. Forget(key string)
  11. Forever(key, value string)
  12. Flush()
  13. IsAlive() error
  14. // Increment 自增
  15. // 当参数只有1个时,为key 增加1
  16. // 当参数有2个时,为key 增加值
  17. Increment(params ...any)
  18. Decrement(params ...any)
  19. }