Documentation ¶
Index ¶
- Variables
- func New() *redisProxy
- func WithClusterOptions(RedisOptions *redis.ClusterOptions) optparams.Option[Options]
- func WithFailoverClusterOptions(RedisOptions *redis.FailoverOptions) optparams.Option[Options]
- func WithFailoverOptions(RedisOptions *redis.FailoverOptions) optparams.Option[Options]
- func WithHooks(hooks ...redis.Hook) optparams.Option[Options]
- func WithOptions(RedisOptions *redis.Options) optparams.Option[Options]
- func WithParallelCallback() optparams.Option[Options]
- func WithQueryTimeoutMS(QueryTimeout int) optparams.Option[Options]
- func WithRingOptions(RedisOptions *redis.RingOptions) optparams.Option[Options]
- func WithURL(URL string) optparams.Option[Options]
- type Callback
- type Options
- type RedisType
Constants ¶
This section is empty.
Variables ¶
View Source
var Default *redisProxy
Default 默认的redis代理对象
View Source
var DefaultOpts = Options{ StandAloneOptions: &redis.Options{Addr: "localhost:6379"}, Type: Redis_Standalone, Parallelcallback: false, Hooks: []redis.Hook{}, }
View Source
var ErrProxyAllreadySettedUniversalClient = errors.New("proxy allready setted universal client")
ErrProxyAllreadySettedUniversalClient 代理已经设置过redis客户端对象
View Source
var ErrProxyNotYetSettedUniversalClient = errors.New("proxy notSet universal client yet")
ErrProxyNotYetSettedUniversalClient 代理还未设置客户端对象
View Source
var ErrUnknownClientType = errors.New("unknown client type")
ErrUnknownClientType 未知的redis客户端类型
Functions ¶
func WithClusterOptions ¶
func WithClusterOptions(RedisOptions *redis.ClusterOptions) optparams.Option[Options]
WithClusterOptions 使用特定redis集群连接设置
func WithFailoverClusterOptions ¶
func WithFailoverClusterOptions(RedisOptions *redis.FailoverOptions) optparams.Option[Options]
WithFailoverOptions 使用特定redis集群哨兵连接设置
func WithFailoverOptions ¶
func WithFailoverOptions(RedisOptions *redis.FailoverOptions) optparams.Option[Options]
WithFailoverOptions 使用特定redis哨兵连接设置
func WithOptions ¶
WithOptions 使用特定单机redis连接设置
func WithParallelCallback ¶
WithParallelCallback 设置初始化后回调并行执行而非串行执行
func WithQueryTimeoutMS ¶
WithQueryTimeoutMS 设置最大请求超时,单位ms
func WithRingOptions ¶
func WithRingOptions(RedisOptions *redis.RingOptions) optparams.Option[Options]
WithRingOptions 使用特定redis的Ring集群连接设置
Types ¶
Click to show internal directories.
Click to hide internal directories.