28 lines
513 B
Go
28 lines
513 B
Go
package redis
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
|
|
"github.com/garyburd/redigo/redis"
|
|
|
|
"git.loafle.net/commons_go/config"
|
|
rp "git.loafle.net/commons_go/redis_pool"
|
|
"go.uber.org/zap"
|
|
)
|
|
|
|
type poolHandlers struct {
|
|
rp.PoolHandlers
|
|
ctx context.Context
|
|
logger *zap.Logger
|
|
cfg config.Configurator
|
|
}
|
|
|
|
func (h *poolHandlers) Dial() (redis.Conn, error) {
|
|
return redis.Dial(h.cfg.GetString("network"), h.cfg.GetString("addr"))
|
|
}
|
|
|
|
func (h *poolHandlers) TestOnBorrow(c redis.Conn, t time.Time) error {
|
|
return nil
|
|
}
|