Documentation
¶
Index ¶
- Variables
- type Message
- type RedisStorage
- func (rs *RedisStorage) Delete(key string) error
- func (rs *RedisStorage) Get(key string) ([]uint8, error)
- func (rs *RedisStorage) GetFloat64(key string) (float64, error)
- func (rs *RedisStorage) GetInt(key string) (int, error)
- func (rs *RedisStorage) GetInt32(key string) (int32, error)
- func (rs *RedisStorage) GetInt64(key string) (int64, error)
- func (rs *RedisStorage) GetString(key string) (string, error)
- func (client *RedisStorage) NewPubSubConn() redis.PubSubConn
- func (r *RedisStorage) Pool() *redis.Pool
- func (client *RedisStorage) Publish(channel, data string)
- func (client *RedisStorage) Receive(psc redis.PubSubConn) *Message
- func (rs *RedisStorage) Set(key string, val interface{}) error
- func (rs *RedisStorage) Setex(key string, val interface{}, duration time.Duration) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNil = redis.ErrNil
View Source
var ErrPoolExhausted = redis.ErrPoolExhausted
Functions ¶
This section is empty.
Types ¶
type RedisStorage ¶
type RedisStorage struct { redis.PubSubConn sync.Mutex // contains filtered or unexported fields }
RedisStorage holds a redis pool and a prefix and is used to Set and Get items from Redis
func NewRedisStorage ¶
func NewRedisStorage(redisHost string, redisConnPoolSize int, redisPrefix string) *RedisStorage
Get a new instance of RedisStorage
func (*RedisStorage) Delete ¶
func (rs *RedisStorage) Delete(key string) error
Remove an item from Redis
func (*RedisStorage) Get ¶
func (rs *RedisStorage) Get(key string) ([]uint8, error)
Get an item from Redis
func (*RedisStorage) GetFloat64 ¶
func (rs *RedisStorage) GetFloat64(key string) (float64, error)
Get float64 value from cached item
func (*RedisStorage) GetInt ¶
func (rs *RedisStorage) GetInt(key string) (int, error)
Get int value from cached item
func (*RedisStorage) GetInt32 ¶
func (rs *RedisStorage) GetInt32(key string) (int32, error)
Get int32 value from cached item
func (*RedisStorage) GetInt64 ¶
func (rs *RedisStorage) GetInt64(key string) (int64, error)
Get int64 value from cached item
func (*RedisStorage) GetString ¶
func (rs *RedisStorage) GetString(key string) (string, error)
Get string value from cached item
func (*RedisStorage) NewPubSubConn ¶
func (client *RedisStorage) NewPubSubConn() redis.PubSubConn
func (*RedisStorage) Pool ¶
func (r *RedisStorage) Pool() *redis.Pool
func (*RedisStorage) Publish ¶
func (client *RedisStorage) Publish(channel, data string)
func (*RedisStorage) Receive ¶
func (client *RedisStorage) Receive(psc redis.PubSubConn) *Message
func (*RedisStorage) Set ¶
func (rs *RedisStorage) Set(key string, val interface{}) error
Set an item on Redis
Click to show internal directories.
Click to hide internal directories.