func TimeRangeUint64(from, to uint64) func(Call) error {
	return func(hc Call) error {
		if c, ok := hc.(hasQueryOptions); ok {
			if from >= to {
				return errors.New("'from' timestamp is greater or equal to 'to' timestamp")
			}
			c.setTimeRangeUint64(from, to)
			return nil
		}
		return errors.New("'TimeRange' option can only be used with Get or Scan request")
	}
}
TimeRangeUint64 is used as a parameter for request creation.
Adds TimeRange constraint to a request.
from and to should be in milliseconds
// It will get values in range [from, to[ ('to' is exclusive).
package hrpc
import (
	"errors"
	"math"
	"time"
	"github.com/tsuna/gohbase/filter"
	"github.com/tsuna/gohbase/pb"
)
type baseQuery struct {
	families      map[string][]string
	filter        *pb.Filter
	fromTimestamp uint64
	toTimestamp   uint64
	maxVersions   uint32
	storeLimit    uint32
	storeOffset   uint32
	cacheBlocks   bool
}
func newBaseQuery() baseQuery {
	return baseQuery{
		storeLimit:    DefaultMaxResultsPerColumnFamily,
		fromTimestamp: MinTimestamp,
		toTimestamp:   MaxTimestamp,
		maxVersions:   DefaultMaxVersions,
		cacheBlocks:   DefaultCacheBlocks,
	}
}
func (bq *baseQuery) setFamilies(families map[string][]string) {
	bq.families = families
}
func (bq *baseQuery) setFilter(filter *pb.Filter) {
	bq.filter = filter
}
func (bq *baseQuery) setTimeRangeUint64(from, to uint64) {
	bq.fromTimestamp = from
	bq.toTimestamp = to
}
func (bq *baseQuery) setMaxVersions(versions uint32) {
	bq.maxVersions = versions
}
func (bq *baseQuery) setMaxResultsPerColumnFamily(maxresults uint32) {
	bq.storeLimit = maxresults
}
func (bq *baseQuery) setResultOffset(offset uint32) {
	bq.storeOffset = offset
}
func (bq *baseQuery) setCacheBlocks(cacheBlocks bool) {
	bq.cacheBlocks = cacheBlocks
}
func Families(f map[string][]string) func(Call) error {
	return func(hc Call) error {
		if c, ok := hc.(hasQueryOptions); ok {
			c.setFamilies(f)
			return nil
		}
		return errors.New("'Families' option can only be used with Get or Scan request")
	}
}
func Filters(f filter.Filter) func(Call) error {
	return func(hc Call) error {
		if c, ok := hc.(hasQueryOptions); ok {
			pbF, err := f.ConstructPBFilter()
			if err != nil {
				return err
			}
			c.setFilter(pbF)
			return nil
		}
		return errors.New("'Filters' option can only be used with Get or Scan request")
	}
}
func TimeRange(from, to time.Time) func(Call) error {
	return TimeRangeUint64(uint64(from.UnixNano()/1e6), uint64(to.UnixNano()/1e6))
}