Merge pull request 'add ability to get *redis.Client' (#111) from redis into master
Reviewed-on: #111
This commit is contained in:
commit
195c604a31
4
redis.go
4
redis.go
@ -43,6 +43,10 @@ func (r *Store) Init(opts ...options.Option) error {
|
||||
return r.configure()
|
||||
}
|
||||
|
||||
func (r *Store) Redis() *redis.Client {
|
||||
return r.cli.(*redis.Client)
|
||||
}
|
||||
|
||||
func (r *Store) Disconnect(ctx context.Context) error {
|
||||
return r.cli.Close()
|
||||
}
|
||||
|
@ -72,11 +72,11 @@ func Test_rkv_configure(t *testing.T) {
|
||||
}
|
||||
for _, tt := range tests {
|
||||
t.Run(tt.name, func(t *testing.T) {
|
||||
r := &Store{
|
||||
rc := &Store{
|
||||
opts: tt.fields.options,
|
||||
cli: tt.fields.Client,
|
||||
}
|
||||
err := r.configure()
|
||||
err := rc.configure()
|
||||
if (err != nil) != tt.wantErr {
|
||||
t.Errorf("configure() error = %v, wantErr %v", err, tt.wantErr)
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user