Documentation ¶
Index ¶
- Constants
- type CacheStorage
- type MemcachedStorage
- func (p *MemcachedStorage) Decrement(key string, delta uint64) (newValue int64, err error)
- func (p *MemcachedStorage) Delete(key string) (err error)
- func (p *MemcachedStorage) DeleteAll() (err error)
- func (p *MemcachedStorage) Get(key string) (v string, err error)
- func (p *MemcachedStorage) GetMulti(keys []string) (values map[string]string, err error)
- func (p *MemcachedStorage) GetMultiObject(keyValues map[string]interface{}) (err error)
- func (p *MemcachedStorage) GetObject(key string, v interface{}) (err error)
- func (p *MemcachedStorage) Increment(key string, delta uint64) (newValue int64, err error)
- func (p *MemcachedStorage) Set(key string, v string, seconds int32) (err error)
- func (p *MemcachedStorage) SetObject(key string, v interface{}, seconds int32) (err error)
- func (p *MemcachedStorage) StorageType() string
- func (p *MemcachedStorage) Touch(key string, seconds int32) (err error)
- type RedisStorage
- func (p *RedisStorage) Decrement(key string, delta uint64) (newValue int64, err error)
- func (p *RedisStorage) Delete(key string) (err error)
- func (p *RedisStorage) DeleteAll() (err error)
- func (p *RedisStorage) Get(key string) (value string, err error)
- func (p *RedisStorage) GetInt(key string) (value int64, err error)
- func (p *RedisStorage) GetMulti(keys []string) (values map[string]string, err error)
- func (p *RedisStorage) GetMultiObject(keyValues map[string]interface{}) (err error)
- func (p *RedisStorage) GetObject(key string, value interface{}) (err error)
- func (p *RedisStorage) GetSet(key, value string) (result string, err error)
- func (p *RedisStorage) Increment(key string, delta uint64) (newValue int64, err error)
- func (p *RedisStorage) Set(key, value string, seconds int32) (err error)
- func (p *RedisStorage) SetInt(key string, value int64, seconds int32) (err error)
- func (p *RedisStorage) SetNX(key, value string) (result int, err error)
- func (p *RedisStorage) SetObject(key string, value interface{}, seconds int32) (err error)
- func (p *RedisStorage) StorageType() string
- func (p *RedisStorage) Touch(key string, seconds int32) (err error)
- type StorageValue
Constants ¶
View Source
const ( MAX_IDLE = 3 IDLE_TIMEOUT = 180 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheStorage ¶
type CacheStorage interface { StorageType() string SetObject(Key string, v interface{}, seconds int32) (err error) GetObject(key string, v interface{}) (err error) GetMultiObject(keyValues map[string]interface{}) (err error) Set(key string, v string, seconds int32) (err error) Get(key string) (v string, err error) GetMulti(keys []string) (values map[string]string, err error) Touch(key string, seconds int32) (err error) Increment(key string, delta uint64) (newValue int64, err error) Decrement(key string, delta uint64) (newValue int64, err error) Delete(key string) error DeleteAll() error }
type MemcachedStorage ¶
type MemcachedStorage struct {
// contains filtered or unexported fields
}
func NewMemcachedStorage ¶
func NewMemcachedStorage(endpoints ...string) (storage *MemcachedStorage, err error)
func (*MemcachedStorage) Decrement ¶
func (p *MemcachedStorage) Decrement(key string, delta uint64) (newValue int64, err error)
func (*MemcachedStorage) Delete ¶
func (p *MemcachedStorage) Delete(key string) (err error)
func (*MemcachedStorage) DeleteAll ¶
func (p *MemcachedStorage) DeleteAll() (err error)
func (*MemcachedStorage) GetMulti ¶
func (p *MemcachedStorage) GetMulti(keys []string) (values map[string]string, err error)
func (*MemcachedStorage) GetMultiObject ¶
func (p *MemcachedStorage) GetMultiObject(keyValues map[string]interface{}) (err error)
func (*MemcachedStorage) GetObject ¶
func (p *MemcachedStorage) GetObject(key string, v interface{}) (err error)
func (*MemcachedStorage) Increment ¶
func (p *MemcachedStorage) Increment(key string, delta uint64) (newValue int64, err error)
func (*MemcachedStorage) Set ¶
func (p *MemcachedStorage) Set(key string, v string, seconds int32) (err error)
func (*MemcachedStorage) SetObject ¶
func (p *MemcachedStorage) SetObject(key string, v interface{}, seconds int32) (err error)
func (*MemcachedStorage) StorageType ¶
func (p *MemcachedStorage) StorageType() string
type RedisStorage ¶
type RedisStorage struct {
// contains filtered or unexported fields
}
func NewAuthRedisStorage ¶
func NewAuthRedisStorage(conn string, db int, auth string) (storage *RedisStorage, err error)
func NewRedisStorage ¶
func NewRedisStorage(conn string, db int) (storage *RedisStorage, err error)
func (*RedisStorage) Decrement ¶
func (p *RedisStorage) Decrement(key string, delta uint64) (newValue int64, err error)
func (*RedisStorage) Delete ¶
func (p *RedisStorage) Delete(key string) (err error)
func (*RedisStorage) DeleteAll ¶
func (p *RedisStorage) DeleteAll() (err error)
func (*RedisStorage) GetMulti ¶
func (p *RedisStorage) GetMulti(keys []string) (values map[string]string, err error)
func (*RedisStorage) GetMultiObject ¶
func (p *RedisStorage) GetMultiObject(keyValues map[string]interface{}) (err error)
func (*RedisStorage) GetObject ¶
func (p *RedisStorage) GetObject(key string, value interface{}) (err error)
get cache from redis.
func (*RedisStorage) GetSet ¶
func (p *RedisStorage) GetSet(key, value string) (result string, err error)
func (*RedisStorage) Increment ¶
func (p *RedisStorage) Increment(key string, delta uint64) (newValue int64, err error)
func (*RedisStorage) SetInt ¶
func (p *RedisStorage) SetInt(key string, value int64, seconds int32) (err error)
func (*RedisStorage) SetNX ¶
func (p *RedisStorage) SetNX(key, value string) (result int, err error)
func (*RedisStorage) SetObject ¶
func (p *RedisStorage) SetObject(key string, value interface{}, seconds int32) (err error)
put cache to redis
func (*RedisStorage) StorageType ¶
func (p *RedisStorage) StorageType() string
type StorageValue ¶
type StorageValue struct {
V interface{} `json:"v"`
}
Click to show internal directories.
Click to hide internal directories.