Versions in this module Expand all Collapse all v0 v0.0.6 Jun 21, 2023 v0.0.5 Jun 13, 2023 Changes in this version + const B64JSONPrefix + var ErrKeyNotFound = errors.New("key not found") + var ErrRedisIsDown = errors.New("storage: Redis is either down or ws not configured") + var HashMurmur128 = "murmur128" + var HashMurmur32 = "murmur32" + var HashMurmur64 = "murmur64" + var HashSha256 = "sha256" + func ConnectToRedis(ctx context.Context, config *Config) + func Connected() bool + func DisableRedis(ok bool) + func GenerateToken(orgID, keyID, hashAlgorithm string) (string, error) + func HashKey(in string) string + func HashStr(in string) string + func NewRedisClusterPool(isCache bool, config *Config) redis.UniversalClient + func TokenHashAlgo(token string) string + func TokenOrg(token string) string + type AnalyticsHandler interface + AppendToSetPipelined func(string, [][]byte) + Connect func() bool + GetAndDeleteSet func(string) []interface{} + GetExp func(string) (int64, error) + SetExp func(string, time.Duration) error + type Config struct + Addrs []string + Database int + EnableCluster bool + EnableTracing bool + Host string + MasterName string + MaxActive int + MaxIdle int + Password string + Port int + SSLInsecureSkipVerify bool + Timeout int + UseSSL bool + Username string + type Handler interface + AddToSet func(string, string) + AddToSortedSet func(string, string, float64) + AppendToSet func(string, string) + Connect func() bool + Decrement func(string) + DeleteAllKeys func() bool + DeleteKey func(string) bool + DeleteKeys func([]string) bool + DeleteRawKey func(string) bool + DeleteScanMatch func(string) bool + Exists func(string) (bool, error) + GetAndDeleteSet func(string) []interface{} + GetExp func(string) (int64, error) + GetKey func(string) (string, error) + GetKeyPrefix func() string + GetKeys func(string) []string + GetKeysAndValues func() map[string]string + GetKeysAndValuesWithFilter func(string) map[string]string + GetListRange func(string, int64, int64) ([]string, error) + GetMultiKey func([]string) ([]string, error) + GetRawKey func(string) (string, error) + GetRollingWindow func(key string, per int64, pipeline bool) (int, []interface{}) + GetSet func(string) (map[string]string, error) + GetSortedSetRange func(string, string, string) ([]string, []float64, error) + IncrememntWithExpire func(string, int64) int64 + RemoveFromList func(string, string) error + RemoveFromSet func(string, string) + RemoveSortedSetRange func(string, string, string) error + SetExp func(string, int64) error + SetKey func(string, string, int64) error + SetRawKey func(string, string, int64) error + SetRollingWindow func(key string, per int64, val string, pipeline bool) (int, []interface{}) + type RedisCluster struct + HashKeys bool + IsCache bool + KeyPrefix string + func (r *RedisCluster) AddToSet(ctx context.Context, keyName, value string) + func (r *RedisCluster) AddToSortedSet(ctx context.Context, keyName, value string, score float64) + func (r *RedisCluster) AppendToSet(ctx context.Context, keyName, value string) + func (r *RedisCluster) AppendToSetPipelined(ctx context.Context, key string, values [][]byte) + func (r *RedisCluster) Connect() bool + func (r *RedisCluster) Decrement(ctx context.Context, keyName string) + func (r *RedisCluster) DeleteAllKeys(ctx context.Context) bool + func (r *RedisCluster) DeleteKey(ctx context.Context, keyName string) bool + func (r *RedisCluster) DeleteKeys(ctx context.Context, keys []string) bool + func (r *RedisCluster) DeleteRawKey(ctx context.Context, keyName string) bool + func (r *RedisCluster) DeleteScanMatch(ctx context.Context, pattern string) bool + func (r *RedisCluster) Exists(ctx context.Context, keyName string) (bool, error) + func (r *RedisCluster) GetAndDeleteSet(ctx context.Context, keyName string) []interface{} + func (r *RedisCluster) GetClient() redis.UniversalClient + func (r *RedisCluster) GetExp(ctx context.Context, keyName string) (int64, error) + func (r *RedisCluster) GetKey(ctx context.Context, keyName string) (string, error) + func (r *RedisCluster) GetKeyPrefix() string + func (r *RedisCluster) GetKeyTTL(ctx context.Context, keyName string) (ttl int64, err error) + func (r *RedisCluster) GetKeys(ctx context.Context, filter string) []string + func (r *RedisCluster) GetKeysAndValues(ctx context.Context) map[string]string + func (r *RedisCluster) GetKeysAndValuesWithFilter(ctx context.Context, filter string) map[string]string + func (r *RedisCluster) GetListRange(ctx context.Context, keyName string, from, to int64) ([]string, error) + func (r *RedisCluster) GetMultiKey(ctx context.Context, keys []string) ([]string, error) + func (r *RedisCluster) GetRawKey(ctx context.Context, keyName string) (string, error) + func (r *RedisCluster) GetSet(ctx context.Context, keyName string) (map[string]string, error) + func (r *RedisCluster) GetSortedSetRange(ctx context.Context, keyName, scoreFrom, scoreTo string) ([]string, []float64, error) + func (r *RedisCluster) IncrememntWithExpire(ctx context.Context, keyName string, expire int64) int64 + func (r *RedisCluster) IsMemberOfSet(ctx context.Context, keyName, value string) bool + func (r *RedisCluster) Publish(ctx context.Context, channel, message string) error + func (r *RedisCluster) RemoveFromList(ctx context.Context, keyName, value string) error + func (r *RedisCluster) RemoveFromSet(ctx context.Context, keyName, value string) + func (r *RedisCluster) RemoveSortedSetRange(ctx context.Context, keyName, scoreFrom, scoreTo string) error + func (r *RedisCluster) SetExp(ctx context.Context, keyName string, timeout time.Duration) error + func (r *RedisCluster) SetKey(ctx context.Context, keyName, session string, timeout time.Duration) error + func (r *RedisCluster) SetRawKey(ctx context.Context, keyName, session string, timeout time.Duration) error + func (r *RedisCluster) SetRollingWindow(ctx context.Context, keyName string, per int64, valueOverride string, ...) (int, []interface{}) + func (r *RedisCluster) StartPubSubHandler(ctx context.Context, channel string, callback func(interface{})) error + func (r RedisCluster) GetRollingWindow(ctx context.Context, keyName string, per int64, pipeline bool) (int, []interface{}) + type RedisOpts redis.UniversalOptions