File tree Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Expand file tree Collapse file tree 3 files changed +10
-10
lines changed Original file line number Diff line number Diff line change 1
- module github.com/ednitioncode/ go-oauth2- redis
1
+ module github.com/go-oauth2/ redis/v4
2
2
3
3
go 1.13
4
4
Original file line number Diff line number Diff line change @@ -19,15 +19,15 @@ var (
19
19
)
20
20
21
21
// 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 {
23
23
if opts == nil {
24
24
panic ("options cannot be nil" )
25
25
}
26
- return NewRedisStoreWithCli (redis .NewClient (opts ), keyNamespace ... )
26
+ return NewRedisStoreWithCli (redis .NewUniversalClient (opts ), keyNamespace ... )
27
27
}
28
28
29
29
// 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 {
31
31
store := & TokenStore {
32
32
cli : cli ,
33
33
}
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ const (
18
18
19
19
func TestTokenStore (t * testing.T ) {
20
20
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 ,
24
24
}
25
25
store := NewRedisStore (opts )
26
26
ctx := context .Background ()
@@ -108,9 +108,9 @@ func TestTokenStore(t *testing.T) {
108
108
func TestTokenStoreWithKeyNamespace (t * testing.T ) {
109
109
ctx := context .Background ()
110
110
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 ,
114
114
}
115
115
store := NewRedisStore (opts , "test:" )
116
116
You can’t perform that action at this time.
0 commit comments