Skip to content

Commit

Permalink
refactor: export IsRedisNil by func
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Dec 26, 2021
1 parent 951d69c commit 374ab8e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions rueidis.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ const (
DefaultPoolSize = 1000
)

var (
IsRedisNil = proto.IsRedisNil
ErrConnClosing = errors.New("connection is closing")
)
var ErrConnClosing = errors.New("connection is closing")

type ConnOption struct {
// CacheSizeEachConn is redis client side cache size that bind to each TCP connection to a single redis instance.
Expand Down Expand Up @@ -50,6 +47,10 @@ func NewSingleClient(option SingleClientOption) (*SingleClient, error) {
return newSingleClient(option, makeConn)
}

func IsRedisNil(err error) bool {
return proto.IsRedisNil(err)
}

func makeConn(dst string, opt ConnOption) conn {
return makeMux(dst, opt, dial)
}
Expand Down

0 comments on commit 374ab8e

Please sign in to comment.