Documentation
¶
Index ¶
- func Del(key string) (int64, error)
- func Get(key string) (string, error)
- func Set(key, value string, expiration time.Duration) error
- func SetRedisClusterConfig(cfg RedisClusterConfig)
- func SetRedisConfig(cfg RedisConfig)
- type RedisCache
- func (c RedisCache) Del(key string) (int64, error)
- func (c RedisCache) DelCluster(key string) (int64, error)
- func (c RedisCache) Get(key string) (string, error)
- func (c RedisCache) GetCluster(key string) (string, error)
- func (c RedisCache) Publish(channel, message string) error
- func (c RedisCache) PublishCluster(channel, message string) error
- func (c RedisCache) Set(key, value string, expiration time.Duration) error
- func (c RedisCache) SetCluster(key, value string, expiration time.Duration) error
- func (c RedisCache) Subscribe(channels string, cb func(channel string, message string, err error))
- func (c RedisCache) SubscribeCluster(channels string, cb func(channel string, message string, err error))
- type RedisClusterConfig
- type RedisConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetRedisClusterConfig ¶
func SetRedisClusterConfig(cfg RedisClusterConfig)
SetRedisClusterConfig set
Types ¶
type RedisCache ¶
type RedisCache struct {
// contains filtered or unexported fields
}
RedisCache define
func NewRedisClusterCache ¶
func NewRedisClusterCache() *RedisCache
NewRedisClusterCache new RedisCluster object
func (RedisCache) DelCluster ¶
func (c RedisCache) DelCluster(key string) (int64, error)
DelCluster Del value from cluster cache
func (RedisCache) Get ¶
func (c RedisCache) Get(key string) (string, error)
Get get value from cache
func (RedisCache) GetCluster ¶
func (c RedisCache) GetCluster(key string) (string, error)
GetCluster get value from cluster cache
func (RedisCache) Publish ¶
func (c RedisCache) Publish(channel, message string) error
Publish publish message
func (RedisCache) PublishCluster ¶
func (c RedisCache) PublishCluster(channel, message string) error
PublishCluster publish message
func (RedisCache) Set ¶
func (c RedisCache) Set(key, value string, expiration time.Duration) error
Set set key-value to cache
func (RedisCache) SetCluster ¶
func (c RedisCache) SetCluster(key, value string, expiration time.Duration) error
SetCluster set key-value to cache
func (RedisCache) Subscribe ¶
func (c RedisCache) Subscribe(channels string, cb func(channel string, message string, err error))
Subscribe subscribe message
func (RedisCache) SubscribeCluster ¶
func (c RedisCache) SubscribeCluster(channels string, cb func(channel string, message string, err error))
SubscribeCluster subscribe cluster message
type RedisClusterConfig ¶
type RedisClusterConfig struct { // A seed list of host:port addresses of cluster nodes. Addrs []string // The maximum number of retries before giving up. Command is retried // on network errors and MOVED/ASK redirects. // Default is 16. MaxRedirects int // Enables read-only commands on slave nodes. ReadOnly bool // Allows routing read-only commands to the closest master or slave node. RouteByLatency bool MaxRetries int MinRetryBackoff time.Duration MaxRetryBackoff time.Duration Password string DialTimeout time.Duration ReadTimeout time.Duration WriteTimeout time.Duration // PoolSize applies per cluster node and not for the whole cluster. PoolSize int PoolTimeout time.Duration IdleTimeout time.Duration IdleCheckFrequency time.Duration }
RedisClusterConfig redis cluster configure
Click to show internal directories.
Click to hide internal directories.