Skip to content

Commit

Permalink
feat: bump v1.0.24
Browse files Browse the repository at this point in the history
  • Loading branch information
rueian committed Dec 15, 2023
1 parent 5cacd16 commit 0c5c4b8
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 53 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ module mymodule
go 1.18
require github.com/redis/rueidis v1.0.23-go1.18
require github.com/redis/rueidis v1.0.24-go1.18
```

## Contributing
Expand Down
4 changes: 2 additions & 2 deletions mux_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func TestNewMux(t *testing.T) {
})
mock.Expect("CLIENT", "TRACKING", "ON", "OPTIN").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("PING").ReplyString("OK")
mock.Close()
Expand Down
8 changes: 4 additions & 4 deletions pipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import (
"github.com/redis/rueidis/internal/util"
)

const LIB_NAME = "rueidis"
const LIB_VER = "1.0.23"
const LibName = "rueidis"
const LibVer = "1.0.24"

var noHello = regexp.MustCompile("unknown command .?(HELLO|hello).?")

Expand Down Expand Up @@ -201,7 +201,7 @@ func _newPipe(connFn func() (net.Conn, error), option *ClientOption, r2ps bool)
if len(option.ClientSetInfo) == 2 {
init = append(init, []string{"CLIENT", "SETINFO", "LIB-NAME", option.ClientSetInfo[0]}, []string{"CLIENT", "SETINFO", "LIB-VER", option.ClientSetInfo[1]})
} else {
init = append(init, []string{"CLIENT", "SETINFO", "LIB-NAME", LIB_NAME}, []string{"CLIENT", "SETINFO", "LIB-VER", LIB_VER})
init = append(init, []string{"CLIENT", "SETINFO", "LIB-NAME", LibName}, []string{"CLIENT", "SETINFO", "LIB-VER", LibVer})
}

timeout := option.Dialer.Timeout
Expand Down Expand Up @@ -282,7 +282,7 @@ func _newPipe(connFn func() (net.Conn, error), option *ClientOption, r2ps bool)
if len(option.ClientSetInfo) == 2 {
init = append(init, []string{"CLIENT", "SETINFO", "LIB-NAME", option.ClientSetInfo[0]}, []string{"CLIENT", "SETINFO", "LIB-VER", option.ClientSetInfo[1]})
} else {
init = append(init, []string{"CLIENT", "SETINFO", "LIB-NAME", LIB_NAME}, []string{"CLIENT", "SETINFO", "LIB-VER", LIB_VER})
init = append(init, []string{"CLIENT", "SETINFO", "LIB-NAME", LibName}, []string{"CLIENT", "SETINFO", "LIB-VER", LibVer})
}
p.version = 5
if len(init) != 0 {
Expand Down
72 changes: 36 additions & 36 deletions pipe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,9 @@ func setup(t *testing.T, option ClientOption) (*pipe, *redisMock, func(), func()
mock.Expect("CLIENT", "TRACKING", "ON", "OPTIN").
ReplyString("OK")
}
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &option)
Expand Down Expand Up @@ -283,9 +283,9 @@ func TestNewPipe(t *testing.T) {
ReplyString("OK")
mock.Expect("SELECT", "1").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -319,9 +319,9 @@ func TestNewPipe(t *testing.T) {
ReplyString("OK")
mock.Expect("SELECT", "1").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -357,9 +357,9 @@ func TestNewPipe(t *testing.T) {
})
mock.Expect("CLIENT", "TRACKING", "ON", "OPTIN", "NOLOOP").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -392,9 +392,9 @@ func TestNewPipe(t *testing.T) {
ReplyString("OK")
mock.Expect("READONLY").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -431,9 +431,9 @@ func TestNewPipe(t *testing.T) {
ReplyString("OK")
mock.Expect("READONLY").
ReplyError("This instance has cluster support disabled")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -490,9 +490,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR unknown command `HELLO`")
mock.Expect("CLIENT", "TRACKING", "ON", "OPTIN").
ReplyError("ERR unknown subcommand or wrong number of arguments for 'TRACKING'. Try CLIENT HELP")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("PING").ReplyString("OK")
}()
Expand All @@ -511,9 +511,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR unknown command `HELLO`")
mock.Expect("CLIENT", "TRACKING", "ON", "OPTIN").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("PING").ReplyString("OK")
}()
Expand All @@ -535,9 +535,9 @@ func TestNewRESP2Pipe(t *testing.T) {
{typ: '+', string: "proto"},
{typ: ':', integer: 2},
}})
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand All @@ -563,19 +563,19 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR unknown command `HELLO`")
mock.Expect("SELECT", "1").
ReplyError("ERR ACL")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("AUTH", "pa").
ReplyString("OK")
mock.Expect("CLIENT", "SETNAME", "cn").
ReplyString("OK")
mock.Expect("SELECT", "1").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -604,19 +604,19 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR unknown command `HELLO`")
mock.Expect("SELECT", "1").
ReplyError("ERR ACL")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("AUTH", "ua", "pa").
ReplyString("OK")
mock.Expect("CLIENT", "SETNAME", "cn").
ReplyString("OK")
mock.Expect("SELECT", "1").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -648,9 +648,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR ACL")
mock.Expect("READONLY").
ReplyError("ERR ACL")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("AUTH", "pa").
ReplyString("OK")
Expand All @@ -660,9 +660,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyString("OK")
mock.Expect("READONLY").
ReplyString("OK")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -694,9 +694,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR ACL")
mock.Expect("READONLY").
ReplyError("ERR ACL")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("AUTH", "pa").
ReplyString("OK")
Expand All @@ -706,9 +706,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyString("OK")
mock.Expect("READONLY").
ReplyError("This instance has cluster support disabled")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
}()
p, err := newPipe(func() (net.Conn, error) { return n1, nil }, &ClientOption{
Expand Down Expand Up @@ -738,9 +738,9 @@ func TestNewRESP2Pipe(t *testing.T) {
ReplyError("ERR unknown command `HELLO`")
mock.Expect("SELECT", "1").
ReplyError("ERR ACL")
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
n1.Close()
n2.Close()
Expand Down
20 changes: 10 additions & 10 deletions rueidis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,9 @@ func TestNewClusterClient(t *testing.T) {
return
}
slots, _ := slotsResp.ToMessage()
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLUSTER", "SLOTS").Reply(slots)
mock.Close()
Expand Down Expand Up @@ -114,9 +114,9 @@ func TestNewClusterClientError(t *testing.T) {
if err != nil {
return
}
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLUSTER", "SLOTS").Reply(RedisMessage{typ: '-', string: "other error"})
mock.Expect("PING").ReplyString("OK")
Expand Down Expand Up @@ -171,9 +171,9 @@ func TestFallBackSingleClient(t *testing.T) {
if err != nil {
return
}
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLUSTER", "SLOTS").Reply(RedisMessage{typ: '-', string: "ERR This instance has cluster support disabled"})
mock.Expect("PING").ReplyString("OK")
Expand Down Expand Up @@ -208,9 +208,9 @@ func TestForceSingleClient(t *testing.T) {
if err != nil {
return
}
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("PING").ReplyString("OK")
mock.Close()
Expand Down Expand Up @@ -290,9 +290,9 @@ func TestTLSClient(t *testing.T) {
if err != nil {
return
}
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LIB_NAME).
mock.Expect("CLIENT", "SETINFO", "LIB-NAME", LibName).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LIB_VER).
mock.Expect("CLIENT", "SETINFO", "LIB-VER", LibVer).
ReplyError("UNKNOWN COMMAND")
mock.Expect("CLUSTER", "SLOTS").Reply(RedisMessage{typ: '-', string: "ERR This instance has cluster support disabled"})
mock.Expect("PING").ReplyString("OK")
Expand Down

0 comments on commit 0c5c4b8

Please sign in to comment.