cache.go 591 B

12345678910111213141516171819
  1. package svc
  2. import "time"
  3. const (
  4. cacheWechatTokenPrefix = "cache:wechat:token:"
  5. cacheErpSchoolTree = "i2bill:cache:erp:school_tree:"
  6. cacheErpActivity = "i2bill:cache:erp:activity:"
  7. cacheErpSchool = "i2bill:cache:erp:school:"
  8. cacheErpNetworkDetailTree = "i2bill:cache:erp:network_detail_tree:"
  9. cacheErpCityTree = "i2bill:cache:erp:city_tree:"
  10. )
  11. // Cache defined
  12. type Cache interface {
  13. SetCache(key string, v interface{}) error
  14. GetCache(key string, v interface{}) error
  15. SetWithExpire(key string, v interface{}, expire time.Duration) error
  16. }