func GreaterOrEqual(val row.Data) rangeArg {
	return func(opts *rangeOptions) {
		opts.greaterOrEqual = val
	}
}
GreaterOrEqual returns a range option that filters on rows greater than or
equal to the given value.
package godata
import (
	"bytes"
	"fmt"
	"github.com/google/btree"
	"github.com/google/godata/group"
	"github.com/google/godata/row"
)
type Frame struct {
	bt *btree.BTree
	indexer row.Indexer
}
func NewFrame(indexer row.Indexer) *Frame {
	return &Frame{
		bt:      btree.New(2),
		indexer: indexer,
	}
}
func (f *Frame) Put(data row.Data) (row.Data, error) {
	index, err := f.indexer.Index(data)
	if err != nil {
		return nil, fmt.Errorf("AddRow: %v", err)
	}
	got := f.bt.ReplaceOrInsert(row.Row{
		Index: index,
		Data:  data,
	})
	if got == nil {
		return nil, nil
	}
	return got.(row.Row).Data, nil
}
func (f *Frame) Get(key row.Data) (row.Data, error) {
	index, err := f.indexer.Index(key)
	if err != nil {
		return nil, err
	}
	got := f.bt.Get(index)
	if got == nil {
		return nil, nil
	}
	return got.(row.Row).Data, nil
}
func (f *Frame) Pop(key row.Data) (row.Data, error) {
	index, err := f.indexer.Index(key)
	if err != nil {
		return nil, err
	}
	got := f.bt.Delete(index)
	if got == nil {
		return nil, nil
	}
	return got.(row.Row).Data, nil
}
type rangeOptions struct {
	greaterOrEqual row.Data
	lessThan       row.Data
}
type rangeArg func(*rangeOptions)
func rangeArgsToOptions(args []rangeArg) *rangeOptions {
	var opts rangeOptions
	for _, a := range args {
		a(&opts)
	}
	return &opts
}