Documentation ¶
Index ¶
- Constants
- Variables
- func NewRedisClusterPool(forceReconnect bool, config RedisStorageConfig) redis.UniversalClient
- type AnalyticsStorage
- type EnvMapString
- type RedisClusterStorageManager
- func (r *RedisClusterStorageManager) Connect() bool
- func (r *RedisClusterStorageManager) GetAndDeleteSet(keyName string, chunkSize int64, expire time.Duration) []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 RedisStorageConfig
Constants ¶
View Source
const ( RedisKeyPrefix string = "analytics-" ANALYTICS_KEYNAME string = "tyk-system-analytics" UptimeAnalytics_KEYNAME string = "tyk-uptime-analytics" )
Variables ¶
View Source
var AvailableStores map[string]AnalyticsStorage
View Source
var ENV_REDIS_PREFIX = "TYK_PMP_REDIS"
Functions ¶
func NewRedisClusterPool ¶
func NewRedisClusterPool(forceReconnect bool, config RedisStorageConfig) redis.UniversalClient
Types ¶
type AnalyticsStorage ¶
type EnvMapString ¶
func (*EnvMapString) Decode ¶
func (e *EnvMapString) Decode(value string) error
type RedisClusterStorageManager ¶
type RedisClusterStorageManager struct { KeyPrefix string HashKeys bool Config RedisStorageConfig // 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, chunkSize int64, expire time.Duration) []interface{}
func (*RedisClusterStorageManager) GetName ¶
func (r *RedisClusterStorageManager) GetName() string
func (*RedisClusterStorageManager) Init ¶
func (r *RedisClusterStorageManager) Init(config interface{}) error
type RedisStorageConfig ¶
type RedisStorageConfig struct { // Deprecated. Type string `json:"type" mapstructure:"type"` // Redis host value. Host string `json:"host" mapstructure:"host"` // Redis port value. Port int `json:"port" mapstructure:"port"` // Deprecated. Use Addrs instead. Hosts EnvMapString `json:"hosts" mapstructure:"hosts"` // Use instead of the host value if you're running a redis cluster with mutliple instances. Addrs []string `json:"addrs" mapstructure:"addrs"` // Sentinel redis master name. MasterName string `json:"master_name" mapstructure:"master_name"` // Sentinel redis password. SentinelPassword string `json:"sentinel_password" mapstructure:"sentinel_password"` // Redis username. Username string `json:"username" mapstructure:"username"` // Redis password. Password string `json:"password" mapstructure:"password"` // Redis database. Database int `json:"database" mapstructure:"database"` // How long to allow for new connections to be established (in milliseconds). Defaults to 5sec. Timeout int `json:"timeout" mapstructure:"timeout"` // Maximum number of idle connections in the pool. MaxIdle int `json:"optimisation_max_idle" mapstructure:"optimisation_max_idle"` // Maximum number of connections allocated by the pool at a given time. When zero, there is no // limit on the number of connections in the pool. Defaults to 500. MaxActive int `json:"optimisation_max_active" mapstructure:"optimisation_max_active"` // Enable this option if you are using a redis cluster. Default is `false`. EnableCluster bool `json:"enable_cluster" mapstructure:"enable_cluster"` // Prefix the redis key names. Defaults to "analytics-". RedisKeyPrefix string `json:"redis_key_prefix" mapstructure:"redis_key_prefix"` // Setting this to true to use SSL when connecting to Redis. RedisUseSSL bool `json:"redis_use_ssl" mapstructure:"redis_use_ssl"` // Set this to `true` to tell Pump to ignore Redis' cert validation. RedisSSLInsecureSkipVerify bool `json:"redis_ssl_insecure_skip_verify" mapstructure:"redis_ssl_insecure_skip_verify"` }
Click to show internal directories.
Click to hide internal directories.