Skip to content

Commit

Permalink
add redigo interface
Browse files Browse the repository at this point in the history
  • Loading branch information
lzakharov committed Oct 31, 2023
1 parent e1f61b4 commit ab335fb
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions redis/redigo/redigo.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ import (
"github.com/gomodule/redigo/redis"
)

type Pool interface {
Get() redis.Conn
GetContext(ctx context.Context) (redis.Conn, error)
}

type pool struct {
delegate *redis.Pool
delegate Pool
}

func (p *pool) Get(ctx context.Context) (redsyncredis.Conn, error) {
Expand All @@ -25,7 +30,7 @@ func (p *pool) Get(ctx context.Context) (redsyncredis.Conn, error) {
}

// NewPool returns a Redigo-based pool implementation.
func NewPool(delegate *redis.Pool) redsyncredis.Pool {
func NewPool(delegate Pool) redsyncredis.Pool {
return &pool{delegate}
}

Expand Down

0 comments on commit ab335fb

Please sign in to comment.