Documentation ¶
Index ¶
- Variables
- func New() *redisProxy
- type Callback
- type Option
- func WithClusterOptions(RedisOptions *redis.ClusterOptions) Option
- func WithFailoverClusterOptions(RedisOptions *redis.FailoverOptions) Option
- func WithFailoverOptions(RedisOptions *redis.FailoverOptions) Option
- func WithHooks(hooks ...redis.Hook) Option
- func WithOptions(RedisOptions *redis.Options) Option
- func WithParallelCallback() Option
- func WithQueryTimeoutMS(QueryTimeout int) Option
- func WithRingOptions(RedisOptions *redis.RingOptions) Option
- func WithURL(URL string) Option
- type Options
- type RedisType
Constants ¶
This section is empty.
Variables ¶
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("代理不能重复设置客户端对象")
ErrProxyAllreadySettedUniversalClient 代理已经设置过redis客户端对象
View Source
var ErrProxyNotYetSettedUniversalClient = errors.New("代理还未设置客户端对象")
ErrProxyNotYetSettedUniversalClient 代理还未设置客户端对象
View Source
var ErrUnknownClientType = errors.New("未知的redis客户端类型")
ErrUnknownClientType 未知的redis客户端类型
View Source
var Proxy = New()
Proxy 默认的redis代理对象
Functions ¶
Types ¶
type Option ¶ added in v0.0.4
type Option interface {
Apply(*Options)
}
Option configures how we set up the connection.
func WithClusterOptions ¶ added in v0.0.4
func WithClusterOptions(RedisOptions *redis.ClusterOptions) Option
WithClusterOptions 使用特定redis集群连接设置
func WithFailoverClusterOptions ¶ added in v0.0.4
func WithFailoverClusterOptions(RedisOptions *redis.FailoverOptions) Option
WithFailoverOptions 使用特定redis集群哨兵连接设置
func WithFailoverOptions ¶ added in v0.0.4
func WithFailoverOptions(RedisOptions *redis.FailoverOptions) Option
WithFailoverOptions 使用特定redis哨兵连接设置
func WithOptions ¶ added in v0.0.4
WithOptions 使用特定单机redis连接设置
func WithParallelCallback ¶ added in v0.0.4
func WithParallelCallback() Option
WithParallelCallback 设置初始化后回调并行执行而非串行执行
func WithQueryTimeoutMS ¶ added in v0.0.7
WithQueryTimeoutMS 设置最大请求超时,单位ms
func WithRingOptions ¶ added in v0.0.4
func WithRingOptions(RedisOptions *redis.RingOptions) Option
WithRingOptions 使用特定redis的Ring集群连接设置
Click to show internal directories.
Click to hide internal directories.