mirror of
https://github.com/charlienet/go-mixed.git
synced 2025-07-18 00:22:41 +08:00
使用接口返回
This commit is contained in:
@ -16,6 +16,8 @@ const (
|
||||
defaultSlowThreshold = time.Millisecond * 100 // 慢查询
|
||||
)
|
||||
|
||||
var Nil = redis.Nil
|
||||
|
||||
var (
|
||||
once sync.Once
|
||||
)
|
||||
@ -43,7 +45,7 @@ type ReidsOption struct {
|
||||
ConnMaxLifetime time.Duration
|
||||
}
|
||||
|
||||
type Client struct {
|
||||
type Client interface {
|
||||
redis.UniversalClient
|
||||
}
|
||||
|
||||
@ -79,5 +81,5 @@ func New(opt *ReidsOption) Client {
|
||||
}
|
||||
})
|
||||
|
||||
return Client{UniversalClient: rdb}
|
||||
return rdb
|
||||
}
|
||||
|
Reference in New Issue
Block a user