Documentation
¶
Index ¶
Constants ¶
View Source
const ( // RouteModeMasterOnly only route read-only commands to master node RouteModeMasterOnly = "master_only" // RouteModeMasterSlaveRandom route read-only commands to both master and slave, using random policy RouteModeMasterSlaveRandom = "master_slave_random" // RouteModeMasterSlaveLatency route read-only commands to both master and slave, using least latency policy RouteModeMasterSlaveLatency = "master_slave_latency" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶ added in v1.1.10
type Client interface {
redis.Cmdable
Do(args ...interface{}) *redis.Cmd
Process(cmd redis.Cmder) error
Close() error
}
Client is the client interface for redis db
type Config ¶
type Config struct {
Addrs []string
Password string
ClusterEnabled bool
ReadOnly bool
RouteMode string
MaxRedirects int
MaxRetries int
MinRetryBackoff time.Duration
MaxRetryBackoff time.Duration
ConnectTimeout time.Duration
ReadTimeout time.Duration
WriteTimeout time.Duration
PoolSize int
MinIdleConns int
MaxConnAge time.Duration
PoolTimeout time.Duration
IdleTimeout time.Duration
IdleCheckFrequency time.Duration
}
Config defines the redis config
Click to show internal directories.
Click to hide internal directories.