Skip to content

Commit e8069df

Browse files
committed
Change redis Client to the UniversalClient.
1 parent ca36268 commit e8069df

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module github.com/ednitioncode/go-oauth2-redis
1+
module github.com/go-oauth2/redis/v4
22

33
go 1.13
44

redis.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ var (
1919
)
2020

2121
// NewRedisStore create an instance of a redis store
22-
func NewRedisStore(opts *redis.Options, keyNamespace ...string) *TokenStore {
22+
func NewRedisStore(opts *redis.UniversalOptions, keyNamespace ...string) *TokenStore {
2323
if opts == nil {
2424
panic("options cannot be nil")
2525
}
26-
return NewRedisStoreWithCli(redis.NewClient(opts), keyNamespace...)
26+
return NewRedisStoreWithCli(redis.NewUniversalClient(opts), keyNamespace...)
2727
}
2828

2929
// NewRedisStoreWithCli create an instance of a redis store
30-
func NewRedisStoreWithCli(cli *redis.Client, keyNamespace ...string) *TokenStore {
30+
func NewRedisStoreWithCli(cli redis.UniversalClient, keyNamespace ...string) *TokenStore {
3131
store := &TokenStore{
3232
cli: cli,
3333
}

redis_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ const (
1818

1919
func TestTokenStore(t *testing.T) {
2020
Convey("Test redis token store", t, func() {
21-
opts := &redis.Options{
22-
Addr: addr,
23-
DB: db,
21+
opts := &redis.UniversalOptions{
22+
Addrs: []string{addr},
23+
DB: db,
2424
}
2525
store := NewRedisStore(opts)
2626
ctx := context.Background()
@@ -108,9 +108,9 @@ func TestTokenStore(t *testing.T) {
108108
func TestTokenStoreWithKeyNamespace(t *testing.T) {
109109
ctx := context.Background()
110110
Convey("Test redis token store", t, func() {
111-
opts := &redis.Options{
112-
Addr: addr,
113-
DB: db,
111+
opts := &redis.UniversalOptions{
112+
Addrs: []string{addr},
113+
DB: db,
114114
}
115115
store := NewRedisStore(opts, "test:")
116116

0 commit comments

Comments
 (0)