redis

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 2 more Imports: 8 Imported by: 0

Documentation

Overview

Package redis provides an redis implementation of the AnalyticsStorage storage interface.

Index

Constants

View Source
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.

func (*RedisClusterStorageManager) SetExp

func (r *RedisClusterStorageManager) SetExp(keyName string, timeout int64) error

SetExp is used to set the expiry of a key.

func (*RedisClusterStorageManager) SetKey

func (r *RedisClusterStorageManager) SetKey(keyName, session string, timeout int64) error

SetKey will create (or update) a key value in the store.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL