update
This commit is contained in:
19
myredis/option.go
Normal file
19
myredis/option.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package myredis
|
||||
|
||||
import (
|
||||
"github.com/redis/go-redis/v9"
|
||||
)
|
||||
|
||||
type Opt func(*Client)
|
||||
|
||||
func WithRedisOpt(v *redis.Options) Opt {
|
||||
return func(r *Client) {
|
||||
r.redisOpt = v
|
||||
}
|
||||
}
|
||||
|
||||
func WithDisablePing(v bool) Opt {
|
||||
return func(r *Client) {
|
||||
r.disablePing = v
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user