Move iterators into separate package

Also reduce API exposure and use standard library more - and fix bugs I
previously introduces in mongo.
This commit is contained in:
kortschak 2014-06-30 22:22:50 +09:30
parent 88be6bee37
commit 1768e593a8
62 changed files with 3240 additions and 3130 deletions

View file

@ -19,19 +19,20 @@ import (
"fmt"
"strings"
"github.com/syndtr/goleveldb/leveldb/iterator"
ldbit "github.com/syndtr/goleveldb/leveldb/iterator"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/google/cayley/graph"
"github.com/google/cayley/graph/iterator"
)
type Iterator struct {
graph.BaseIterator
iterator.Base
nextPrefix []byte
checkId []byte
dir graph.Direction
open bool
it iterator.Iterator
it ldbit.Iterator
ts *TripleStore
ro *opt.ReadOptions
originalPrefix string
@ -39,7 +40,7 @@ type Iterator struct {
func NewIterator(prefix string, d graph.Direction, value graph.TSVal, ts *TripleStore) *Iterator {
var it Iterator
graph.BaseIteratorInit(&it.BaseIterator)
iterator.BaseInit(&it.Base)
it.checkId = value.([]byte)
it.dir = d
it.originalPrefix = prefix