Merge pull request 'add ability to get *redis.Client' (#111) from redis into master
Some checks failed
build / test (push) Failing after 1m28s
build / lint (push) Failing after 2m34s
codeql / analyze (go) (push) Failing after 2m44s

Reviewed-on: #111
This commit is contained in:
Василий Толстов 2023-12-12 13:53:00 +03:00
commit 195c604a31
2 changed files with 6 additions and 2 deletions

View File

@ -43,6 +43,10 @@ func (r *Store) Init(opts ...options.Option) error {
return r.configure() return r.configure()
} }
func (r *Store) Redis() *redis.Client {
return r.cli.(*redis.Client)
}
func (r *Store) Disconnect(ctx context.Context) error { func (r *Store) Disconnect(ctx context.Context) error {
return r.cli.Close() return r.cli.Close()
} }

View File

@ -72,11 +72,11 @@ func Test_rkv_configure(t *testing.T) {
} }
for _, tt := range tests { for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) { t.Run(tt.name, func(t *testing.T) {
r := &Store{ rc := &Store{
opts: tt.fields.options, opts: tt.fields.options,
cli: tt.fields.Client, cli: tt.fields.Client,
} }
err := r.configure() err := rc.configure()
if (err != nil) != tt.wantErr { if (err != nil) != tt.wantErr {
t.Errorf("configure() error = %v, wantErr %v", err, tt.wantErr) t.Errorf("configure() error = %v, wantErr %v", err, tt.wantErr)
return return