Documentation ¶
Index ¶
- type CacheService
- func (cs *CacheService) Flush()
- func (cs *CacheService) Forever(key string, value string)
- func (cs *CacheService) Forget(key string)
- func (cs *CacheService) Get(key string) interface{}
- func (cs *CacheService) GetObject(key string, wanted interface{}) error
- func (cs *CacheService) Has(key string) bool
- func (cs *CacheService) Remember(key string, expireTime time.Duration, callback func() interface{}) interface{}
- func (cs *CacheService) Set(key string, obj interface{}, expireTime time.Duration)
- type LocalStore
- func (s *LocalStore) Decr(key string)
- func (s *LocalStore) DecrBy(key string, value int64)
- func (s *LocalStore) Flush()
- func (s *LocalStore) Forever(key string, value string)
- func (s *LocalStore) Forget(key string)
- func (s *LocalStore) Get(key string) string
- func (s *LocalStore) Has(key string) bool
- func (s *LocalStore) Incr(key string)
- func (s *LocalStore) IncrBy(key string, value int64)
- func (s *LocalStore) Set(key string, value string, expireTime time.Duration)
- type MultiStore
- func (s *MultiStore) Decr(key string)
- func (s *MultiStore) DecrBy(key string, value int64)
- func (s *MultiStore) Flush()
- func (s *MultiStore) Forever(key string, value string)
- func (s *MultiStore) Forget(key string)
- func (s *MultiStore) Get(key string) string
- func (s *MultiStore) Has(key string) bool
- func (s *MultiStore) Incr(key string)
- func (s *MultiStore) IncrBy(key string, value int64)
- func (s *MultiStore) Set(key string, value string, expireTime time.Duration)
- type RedisStore
- func (s *RedisStore) Decr(key string)
- func (s *RedisStore) DecrBy(key string, value int64)
- func (s *RedisStore) Flush()
- func (s *RedisStore) Forever(key string, value string)
- func (s *RedisStore) Forget(key string)
- func (s *RedisStore) Get(key string) string
- func (s *RedisStore) Has(key string) bool
- func (s *RedisStore) Incr(key string)
- func (s *RedisStore) IncrBy(key string, value int64)
- func (s *RedisStore) Set(key string, value string, expireTime time.Duration)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheService ¶
type CacheService struct {
Store Store
}
func NewService ¶
func NewService(store Store) *CacheService
func (*CacheService) Flush ¶
func (cs *CacheService) Flush()
func (*CacheService) Forever ¶
func (cs *CacheService) Forever(key string, value string)
func (*CacheService) Forget ¶
func (cs *CacheService) Forget(key string)
func (*CacheService) Get ¶
func (cs *CacheService) Get(key string) interface{}
func (*CacheService) GetObject ¶
func (cs *CacheService) GetObject(key string, wanted interface{}) error
func (*CacheService) Has ¶
func (cs *CacheService) Has(key string) bool
type LocalStore ¶
type LocalStore struct { GoCacheClient *cache.Cache KeyPrefix string }
func (*LocalStore) Decr ¶
func (s *LocalStore) Decr(key string)
func (*LocalStore) DecrBy ¶
func (s *LocalStore) DecrBy(key string, value int64)
func (*LocalStore) Flush ¶
func (s *LocalStore) Flush()
func (*LocalStore) Forever ¶
func (s *LocalStore) Forever(key string, value string)
func (*LocalStore) Forget ¶
func (s *LocalStore) Forget(key string)
func (*LocalStore) Get ¶
func (s *LocalStore) Get(key string) string
func (*LocalStore) Has ¶
func (s *LocalStore) Has(key string) bool
func (*LocalStore) Incr ¶
func (s *LocalStore) Incr(key string)
func (*LocalStore) IncrBy ¶
func (s *LocalStore) IncrBy(key string, value int64)
type MultiStore ¶
type MultiStore struct { LocalStore *LocalStore RedisStore *RedisStore }
func (*MultiStore) Decr ¶
func (s *MultiStore) Decr(key string)
func (*MultiStore) DecrBy ¶
func (s *MultiStore) DecrBy(key string, value int64)
func (*MultiStore) Flush ¶
func (s *MultiStore) Flush()
func (*MultiStore) Forever ¶
func (s *MultiStore) Forever(key string, value string)
func (*MultiStore) Forget ¶
func (s *MultiStore) Forget(key string)
func (*MultiStore) Get ¶
func (s *MultiStore) Get(key string) string
func (*MultiStore) Has ¶
func (s *MultiStore) Has(key string) bool
func (*MultiStore) Incr ¶
func (s *MultiStore) Incr(key string)
func (*MultiStore) IncrBy ¶
func (s *MultiStore) IncrBy(key string, value int64)
type RedisStore ¶
type RedisStore struct { RedisClient *redis.RedisClient KeyPrefix string }
func (*RedisStore) Decr ¶
func (s *RedisStore) Decr(key string)
func (*RedisStore) DecrBy ¶
func (s *RedisStore) DecrBy(key string, value int64)
func (*RedisStore) Flush ¶
func (s *RedisStore) Flush()
func (*RedisStore) Forever ¶
func (s *RedisStore) Forever(key string, value string)
func (*RedisStore) Forget ¶
func (s *RedisStore) Forget(key string)
func (*RedisStore) Get ¶
func (s *RedisStore) Get(key string) string
func (*RedisStore) Has ¶
func (s *RedisStore) Has(key string) bool
func (*RedisStore) Incr ¶
func (s *RedisStore) Incr(key string)
func (*RedisStore) IncrBy ¶
func (s *RedisStore) IncrBy(key string, value int64)
Click to show internal directories.
Click to hide internal directories.