type.go 595 B

1234567891011121314151617181920212223242526272829
  1. package cache
  2. import (
  3. "time"
  4. "github.com/matchstalk/go-admin-core/cache"
  5. )
  6. type Adapter interface {
  7. Connect() error
  8. Get(key string) (string, error)
  9. Set(key string, val interface{}, expire int) error
  10. Del(key string) error
  11. HashGet(hk, key string) (string, error)
  12. HashDel(hk, key string) error
  13. Increase(key string) error
  14. Decrease(key string) error
  15. Expire(key string, dur time.Duration) error
  16. cache.AdapterQueue
  17. }
  18. type Message interface {
  19. SetID(string)
  20. SetStream(string)
  21. SetValues(map[string]interface{})
  22. GetID() string
  23. GetStream() string
  24. GetValues() map[string]interface{}
  25. }