Documentation ¶
Overview ¶
Package redis provides an redis implementation of the AnalyticsStorage storage interface.
Index ¶
- Constants
- func NewRedisClusterPool(forceReconnect bool, config genericoptions.RedisOptions) redis.UniversalClient
- type RedisClusterStorageManager
- func (r *RedisClusterStorageManager) Connect() bool
- func (r *RedisClusterStorageManager) GetAndDeleteSet(keyName string) []interface{}
- func (r *RedisClusterStorageManager) GetName() string
- func (r *RedisClusterStorageManager) Init(config interface{}) error
- func (r *RedisClusterStorageManager) SetExp(keyName string, timeout int64) error
- func (r *RedisClusterStorageManager) SetKey(keyName, session string, timeout int64) error
- type RedisOpts
Constants ¶
const (
RedisKeyPrefix = "analytics-"
)
RedisKeyPrefix defines prefix for iam analytics key.
Variables ¶
This section is empty.
Functions ¶
func NewRedisClusterPool ¶
func NewRedisClusterPool(forceReconnect bool, config genericoptions.RedisOptions) redis.UniversalClient
NewRedisClusterPool returns a redis cluster client.
Types ¶
type RedisClusterStorageManager ¶
type RedisClusterStorageManager struct { KeyPrefix string HashKeys bool Config genericoptions.RedisOptions // contains filtered or unexported fields }
RedisClusterStorageManager is a storage manager that uses the redis database.
func (*RedisClusterStorageManager) Connect ¶
func (r *RedisClusterStorageManager) Connect() bool
Connect will establish a connection to the r.db.
func (*RedisClusterStorageManager) GetAndDeleteSet ¶
func (r *RedisClusterStorageManager) GetAndDeleteSet(keyName string) []interface{}
GetAndDeleteSet get and delete key from redis.
func (*RedisClusterStorageManager) GetName ¶
func (r *RedisClusterStorageManager) GetName() string
GetName returns the redis cluster storage manager name.
func (*RedisClusterStorageManager) Init ¶
func (r *RedisClusterStorageManager) Init(config interface{}) error
Init initialize the redis cluster storage manager.
type RedisOpts ¶
type RedisOpts redis.UniversalOptions
RedisOpts is the overridden type of redis.UniversalOptions. simple() and cluster() functions are not public in redis library. Therefore, they are redefined in here to use in creation of new redis cluster logic. We don't want to use redis.NewUniversalClient() logic.