func (c *RedisClient) GetRangeInto(key string, start, end int64, dst []byte) (int, error) {
	conn := c.pool.Get()
	defer conn.Close()
	conn.SetReadBuffer(dst)
	defer conn.UnsetReadBuffer()
	read, err := redis.ReadBytes(conn.Do("GETRANGE", key, start, end))
	if err == redis.ErrNil {
		return 0, ErrRedisKeyNotFound
	}
	return read, err
}
GetRangeInto implements GETRANGE redis command with an input destination buffer to read bytes into.
The actual number of bytes read is returned.
If dst is too small, it will panic.
package redisfs
import (
	"errors"
	"fmt"
	"strings"
	"github.com/cea-hpc/pdwfs/config"
	"github.com/cea-hpc/pdwfs/redigo/redis"
	"github.com/cea-hpc/pdwfs/util"
)
var (
	ErrRedisKeyNotFound = errors.New("Redis key not found")
)
func Try(err error) {
	if err != nil {
		panic(err)
	}
}
var Check = Try
func err(a interface{}, err error) error {
	return err
}
type RedisClient struct {
	pool *redis.Pool
}
func NewRedisClient(addr string) *RedisClient {
	return &RedisClient{
		pool: &redis.Pool{
			MaxIdle:     5,
			MaxActive:   50,    
			Wait:        true,  
			IdleTimeout: 0,
			Dial: func() (redis.Conn, error) {
				return redis.Dial("tcp", addr)
			},
		},
	}
}
func (c *RedisClient) Close() error {
	return c.pool.Close()
}
func (c *RedisClient) SetRange(key string, offset int64, data []byte) error {
	conn := c.pool.Get()
	defer conn.Close()
	return err(conn.Do("SETRANGE", key, offset, data))
}
func (c *RedisClient) GetRange(key string, start, end int64) ([]byte, error) {
	conn := c.pool.Get()
	defer conn.Close()
	b, err := redis.Bytes(conn.Do("GETRANGE", key, start, end))
	if err == redis.ErrNil {
		return b, ErrRedisKeyNotFound
	}
	return b, err
}