code: func NewRedis(opts *RedisOpts) *Redis {
  	pool := &redis.Pool{
  		MaxActive:   opts.MaxActive,
  		MaxIdle:     opts.MaxIdle,
  		IdleTimeout: time.Second * time.Duration(opts.IdleTimeout),
  		Dial: func() (redis.Conn, error) {
  			return redis.Dial("tcp", opts.Host,
  				redis.DialDatabase(opts.Database),
  				redis.DialPassword(opts.Password),
  			)
  		},
  		TestOnBorrow: func(conn redis.Conn, t time.Time) error {
  			if time.Since(t) < time.Minute {
  				return nil
  			}
  			_, err := conn.Do("PING")
  			return err
  		},
  	}
  	return &Redis{pool}
  }
docs: //NewRedis 实例化