Documentation
¶
Index ¶
- Variables
- func Init()
- type Cache
- type MemoryCache
- func (m *MemoryCache) Del(key string) (int64, error)
- func (m *MemoryCache) FlushDB() error
- func (m *MemoryCache) HDel(key string, fields ...string) (int64, error)
- func (m *MemoryCache) HGet(key, field string) (string, error)
- func (m *MemoryCache) HGetAll(key string) (map[string]string, error)
- func (m *MemoryCache) HSet(key, field string, value interface{}) error
- func (m *MemoryCache) Keys(pattern string) ([]string, error)
- func (m *MemoryCache) Ping() error
- type RedisCache
- func (r *RedisCache) Del(key string) (int64, error)
- func (r *RedisCache) FlushDB() error
- func (r *RedisCache) HDel(key string, fields ...string) (int64, error)
- func (r *RedisCache) HGet(key, field string) (string, error)
- func (r *RedisCache) HGetAll(key string) (map[string]string, error)
- func (r *RedisCache) HSet(key, field string, value interface{}) error
- func (r *RedisCache) Keys(pattern string) ([]string, error)
- func (r *RedisCache) Ping() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("not found")
Functions ¶
Types ¶
type Cache ¶
type Cache interface {
Ping() error
HSet(key, field string, value interface{}) error
HGet(key, field string) (string, error)
HGetAll(key string) (map[string]string, error)
HDel(key string, fields ...string) (int64, error)
Del(key string) (int64, error)
Keys(pattern string) ([]string, error)
FlushDB() error
}
var Store Cache
type MemoryCache ¶
type MemoryCache struct {
// contains filtered or unexported fields
}
func NewMemoryCache ¶
func NewMemoryCache() *MemoryCache
func (*MemoryCache) FlushDB ¶
func (m *MemoryCache) FlushDB() error
func (*MemoryCache) HSet ¶
func (m *MemoryCache) HSet(key, field string, value interface{}) error
func (*MemoryCache) Ping ¶
func (m *MemoryCache) Ping() error
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
func NewRedisCache ¶
func NewRedisCache() *RedisCache
func (*RedisCache) FlushDB ¶
func (r *RedisCache) FlushDB() error
func (*RedisCache) HSet ¶
func (r *RedisCache) HSet(key, field string, value interface{}) error
func (*RedisCache) Ping ¶
func (r *RedisCache) Ping() error
Click to show internal directories.
Click to hide internal directories.