deprecated_overflow_gateway.../redis/pool_handlers.go

28 lines
513 B
Go
Raw Normal View History

2017-09-11 02:24:18 +00:00
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
}