Documentation ¶
Index ¶
- func BLPop(key string, val interface{}) error
- func BLPopString(key string) (string, error)
- func BRPop(key string, val interface{}) error
- func BRPopString(key string) (string, error)
- func Del(keys ...string) error
- func DelPattern(pattern string) error
- func Exists(keys ...string) bool
- func Expire(key string, expiration time.Duration) bool
- func FlushAll() error
- func FlushAllAsync() error
- func FlushDB() error
- func FlushDBAsync() error
- func Get(key string, val interface{}) error
- func GetInt(key string) int
- func GetString(key string) string
- func HDel(key string, fields ...string) error
- func HDelAll(key string)
- func HExists(key, field string) bool
- func HGet(key, field string, val interface{}) error
- func HGetAll(key string) (map[string]string, error)
- func HKeys(key string) ([]string, error)
- func HSet(key, field string, val interface{}) error
- func InitStoreKeeper(cfg config.StoresConf)
- func IsRedisNull(err error) bool
- func LLen(key string) int64
- func LPop(key string, val interface{}) error
- func LPush(key string, values ...interface{}) error
- func RPop(key string, val interface{}) error
- func RPush(key string, values ...interface{}) error
- func Set(key string, value interface{}, expire time.Duration) error
- func SetNx(key string, value interface{}, expire time.Duration) error
- func ZAdd(key string, members ...*redis.Z) error
- func ZCard(key string) int64
- func ZIncrBy(key string, increment float64, member string) (float64, error)
- func ZRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func ZRem(key string, members ...interface{}) error
- func ZRevRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func ZRevRank(key, member string) (int64, error)
- func ZScore(key, member string) float64
- type StoreKeeper
- type StoreRedis
- func (s *StoreRedis) BLPop(key string, val interface{}) error
- func (s *StoreRedis) BLPopString(key string) (string, error)
- func (s *StoreRedis) BRPop(key string, val interface{}) error
- func (s *StoreRedis) BRPopString(key string) (string, error)
- func (s *StoreRedis) Del(keys ...string) error
- func (s *StoreRedis) DelPattern(pattern string) error
- func (s *StoreRedis) Exists(keys ...string) bool
- func (s *StoreRedis) Expire(key string, expiration time.Duration) bool
- func (s *StoreRedis) FlushAll() error
- func (s *StoreRedis) FlushAllAsync() error
- func (s *StoreRedis) FlushDB() error
- func (s *StoreRedis) FlushDBAsync() error
- func (s *StoreRedis) Get(key string, val interface{}) error
- func (s *StoreRedis) GetInt(key string) int
- func (s *StoreRedis) GetKey(key string) string
- func (s *StoreRedis) GetKeys(keys []string) []string
- func (s *StoreRedis) GetString(key string) string
- func (s *StoreRedis) GetValues(values []interface{}) []interface{}
- func (s *StoreRedis) HDel(key string, fields ...string) error
- func (s *StoreRedis) HDelAll(key string)
- func (s *StoreRedis) HExists(key, field string) bool
- func (s *StoreRedis) HGet(key, field string, val interface{}) error
- func (s *StoreRedis) HGetAll(key string) (map[string]string, error)
- func (s *StoreRedis) HKeys(key string) ([]string, error)
- func (s *StoreRedis) HSet(key, field string, val interface{}) error
- func (s *StoreRedis) IsRedisNull(err error) bool
- func (s *StoreRedis) LLen(key string) int64
- func (s *StoreRedis) LPop(key string, val interface{}) error
- func (s *StoreRedis) LPush(key string, values ...interface{}) error
- func (s *StoreRedis) RPop(key string, val interface{}) error
- func (s *StoreRedis) RPush(key string, values ...interface{}) error
- func (s *StoreRedis) Set(key string, value interface{}, expire time.Duration) error
- func (s *StoreRedis) SetNx(key string, value interface{}, expire time.Duration) error
- func (s *StoreRedis) ZAdd(key string, members ...*redis.Z) error
- func (s *StoreRedis) ZCard(key string) int64
- func (s *StoreRedis) ZIncrBy(key string, increment float64, member string) (float64, error)
- func (s *StoreRedis) ZRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func (s *StoreRedis) ZRem(key string, members ...interface{}) error
- func (s *StoreRedis) ZRevRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
- func (s *StoreRedis) ZRevRank(key, member string) (int64, error)
- func (s *StoreRedis) ZScore(key, member string) float64
- type StoreRedisOption
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BLPopString ¶
func BRPopString ¶
func DelPattern ¶
func FlushAllAsync ¶
func FlushAllAsync() error
func FlushDBAsync ¶
func FlushDBAsync() error
func InitStoreKeeper ¶
func InitStoreKeeper(cfg config.StoresConf)
func IsRedisNull ¶
func ZRangeWithScores ¶
func ZRevRangeWithScores ¶
Types ¶
type StoreKeeper ¶
type StoreKeeper interface { Set(key string, value interface{}, expire time.Duration) error SetNx(key string, value interface{}, expire time.Duration) error //set if not exist Get(key string, val interface{}) error GetInt(key string) int GetString(key string) string Del(keys ...string) error DelPattern(pattern string) error Exists(keys ...string) bool HSet(key, field string, val interface{}) error HGet(key, field string, val interface{}) error HGetAll(key string) (map[string]string, error) HDel(key string, fields ...string) error HDelAll(key string) HExists(key, field string) bool Expire(key string, expiration time.Duration) bool HKeys(key string) ([]string, error) ZAdd(key string, members ...*redis.Z) error ZRangeWithScores(key string, start, stop int64) ([]redis.Z, error) ZRevRangeWithScores(key string, start, stop int64) ([]redis.Z, error) ZRevRank(key, member string) (int64, error) ZScore(key, member string) float64 ZIncrBy(key string, increment float64, member string) (float64, error) ZRem(key string, members ...interface{}) error ZCard(key string) int64 LPush(key string, values ...interface{}) error RPush(key string, values ...interface{}) error LPop(key string, val interface{}) error RPop(key string, val interface{}) error BLPop(key string, val interface{}) error BRPop(key string, val interface{}) error BLPopString(key string) (string, error) BRPopString(key string) (string, error) LLen(key string) int64 IsRedisNull(err error) bool FlushDB() error FlushDBAsync() error FlushAll() error FlushAllAsync() error }
StoreKeeper stores interface
type StoreRedis ¶
type StoreRedis struct { Endpoints []string Password string DB int DialTimeout time.Duration Client *redis.Client Prefix string }
func NewStoreRedis ¶
func NewStoreRedis(opts ...StoreRedisOption) *StoreRedis
func (*StoreRedis) BLPop ¶
func (s *StoreRedis) BLPop(key string, val interface{}) error
func (*StoreRedis) BLPopString ¶
func (s *StoreRedis) BLPopString(key string) (string, error)
func (*StoreRedis) BRPop ¶
func (s *StoreRedis) BRPop(key string, val interface{}) error
func (*StoreRedis) BRPopString ¶
func (s *StoreRedis) BRPopString(key string) (string, error)
func (*StoreRedis) Del ¶
func (s *StoreRedis) Del(keys ...string) error
func (*StoreRedis) DelPattern ¶
func (s *StoreRedis) DelPattern(pattern string) error
func (*StoreRedis) Exists ¶
func (s *StoreRedis) Exists(keys ...string) bool
func (*StoreRedis) FlushAll ¶
func (s *StoreRedis) FlushAll() error
func (*StoreRedis) FlushAllAsync ¶
func (s *StoreRedis) FlushAllAsync() error
func (*StoreRedis) FlushDB ¶
func (s *StoreRedis) FlushDB() error
func (*StoreRedis) FlushDBAsync ¶
func (s *StoreRedis) FlushDBAsync() error
func (*StoreRedis) Get ¶
func (s *StoreRedis) Get(key string, val interface{}) error
func (*StoreRedis) GetInt ¶
func (s *StoreRedis) GetInt(key string) int
func (*StoreRedis) GetKey ¶
func (s *StoreRedis) GetKey(key string) string
func (*StoreRedis) GetKeys ¶
func (s *StoreRedis) GetKeys(keys []string) []string
func (*StoreRedis) GetString ¶
func (s *StoreRedis) GetString(key string) string
func (*StoreRedis) GetValues ¶
func (s *StoreRedis) GetValues(values []interface{}) []interface{}
func (*StoreRedis) HDelAll ¶
func (s *StoreRedis) HDelAll(key string)
func (*StoreRedis) HExists ¶
func (s *StoreRedis) HExists(key, field string) bool
func (*StoreRedis) HGet ¶
func (s *StoreRedis) HGet(key, field string, val interface{}) error
func (*StoreRedis) HSet ¶
func (s *StoreRedis) HSet(key, field string, val interface{}) error
func (*StoreRedis) IsRedisNull ¶
func (s *StoreRedis) IsRedisNull(err error) bool
func (*StoreRedis) LLen ¶
func (s *StoreRedis) LLen(key string) int64
func (*StoreRedis) LPop ¶
func (s *StoreRedis) LPop(key string, val interface{}) error
func (*StoreRedis) LPush ¶
func (s *StoreRedis) LPush(key string, values ...interface{}) error
func (*StoreRedis) RPop ¶
func (s *StoreRedis) RPop(key string, val interface{}) error
func (*StoreRedis) RPush ¶
func (s *StoreRedis) RPush(key string, values ...interface{}) error
func (*StoreRedis) Set ¶
func (s *StoreRedis) Set(key string, value interface{}, expire time.Duration) error
func (*StoreRedis) SetNx ¶
func (s *StoreRedis) SetNx(key string, value interface{}, expire time.Duration) error
func (*StoreRedis) ZAdd ¶
func (s *StoreRedis) ZAdd(key string, members ...*redis.Z) error
func (*StoreRedis) ZCard ¶
func (s *StoreRedis) ZCard(key string) int64
func (*StoreRedis) ZRangeWithScores ¶
func (s *StoreRedis) ZRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
func (*StoreRedis) ZRem ¶
func (s *StoreRedis) ZRem(key string, members ...interface{}) error
func (*StoreRedis) ZRevRangeWithScores ¶
func (s *StoreRedis) ZRevRangeWithScores(key string, start, stop int64) ([]redis.Z, error)
func (*StoreRedis) ZScore ¶
func (s *StoreRedis) ZScore(key, member string) float64
type StoreRedisOption ¶
type StoreRedisOption func(s *StoreRedis)
func WithRedisDB ¶
func WithRedisDB(DB int) StoreRedisOption
func WithRedisDialTimeout ¶
func WithRedisDialTimeout(timeout time.Duration) StoreRedisOption
func WithRedisEndpoints ¶
func WithRedisEndpoints(endpoints []string) StoreRedisOption
func WithRedisPassword ¶
func WithRedisPassword(password string) StoreRedisOption
func WithRedisPrefix ¶
func WithRedisPrefix(prefix string) StoreRedisOption
Click to show internal directories.
Click to hide internal directories.