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 ¶
type Client interface { redis.Cmdable Do(context context.Context, args ...interface{}) *redis.Cmd Process(context context.Context, cmd redis.Cmder) error Close() error }
Client is the client interface for redis db
type Config ¶
type Config struct { Addrs []string DB int 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 PoolTimeout time.Duration MinIdleConns int MaxIdleConns int MaxActiveConns int ConnMaxIdleTime time.Duration ConnMaxLifetime time.Duration }
Config defines the redis config
Click to show internal directories.
Click to hide internal directories.