Documentation
¶
Index ¶
- Variables
- func RegisterDriver(name string, register DriverRegister)
- type CacheAble
- type DriverRegister
- type GoCache
- func (c *GoCache) Add(key string, data interface{}, d time.Duration) bool
- func (c *GoCache) Decrement(key string) bool
- func (c *GoCache) Forever(key string, data interface{})
- func (c *GoCache) Get(key string, object interface{}) (Value, bool)
- func (c *GoCache) Has(key string) bool
- func (c *GoCache) Increment(key string) bool
- func (c *GoCache) Put(key string, data interface{}, d time.Duration)
- func (c *GoCache) Remove(key string) bool
- type Manager
- func (m *Manager) Add(key string, data interface{}, d time.Duration) bool
- func (m *Manager) Decrement(key string) bool
- func (m *Manager) Forever(key string, data interface{})
- func (m *Manager) Get(key string, object interface{}) (Value, bool)
- func (m *Manager) Has(key string) bool
- func (m *Manager) Increment(key string) bool
- func (m *Manager) Put(key string, data interface{}, d time.Duration)
- func (m *Manager) Remove(key string) bool
- func (m *Manager) Use(driver string) error
- type RedisCache
- func (r *RedisCache) Add(key string, data interface{}, d time.Duration) bool
- func (r *RedisCache) Decrement(key string) bool
- func (r *RedisCache) Forever(key string, data interface{})
- func (r *RedisCache) Get(key string, object interface{}) (Value, bool)
- func (r *RedisCache) Has(key string) bool
- func (r *RedisCache) Increment(key string) bool
- func (r *RedisCache) NativeCall(f func(c RedisClient) error) error
- func (r *RedisCache) Put(key string, data interface{}, d time.Duration)
- func (r *RedisCache) Remove(key string) bool
- type RedisClient
- type Repository
- type Value
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultExpiration = time.Minute * 20 CleanupInterval = time.Minute * 10 )
View Source
var (
DriverRegisters = make(map[string]DriverRegister)
)
Functions ¶
func RegisterDriver ¶
func RegisterDriver(name string, register DriverRegister)
Types ¶
type DriverRegister ¶
type DriverRegister func() Repository
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache(codec *cache.Codec) *RedisCache
func (*RedisCache) Add ¶
func (r *RedisCache) Add(key string, data interface{}, d time.Duration) bool
func (*RedisCache) Decrement ¶
func (r *RedisCache) Decrement(key string) bool
func (*RedisCache) Forever ¶
func (r *RedisCache) Forever(key string, data interface{})
func (*RedisCache) Has ¶
func (r *RedisCache) Has(key string) bool
func (*RedisCache) Increment ¶
func (r *RedisCache) Increment(key string) bool
func (*RedisCache) NativeCall ¶
func (r *RedisCache) NativeCall(f func(c RedisClient) error) error
func (*RedisCache) Remove ¶
func (r *RedisCache) Remove(key string) bool
type RedisClient ¶
type Repository ¶
type Repository interface { Has(key string) bool Get(key string, object interface{}) (Value, bool) Put(key string, data interface{}, d time.Duration) Forever(key string, data interface{}) Remove(key string) bool Increment(key string) bool Decrement(key string) bool Add(key string, data interface{}, d time.Duration) bool }
Click to show internal directories.
Click to hide internal directories.