Rewrite keys into concrete types, remove key package

This commit is contained in:
Barak Michener 2015-02-21 15:51:25 -05:00
parent 969aa1a6c3
commit cf3e286d15
9 changed files with 98 additions and 96 deletions

View file

@ -170,8 +170,8 @@ func TestLoadDatabase(t *testing.T) {
//Test horizon
horizon := qs.Horizon()
if horizon.Int() != 1 {
t.Errorf("Unexpected horizon value, got:%d expect:1", horizon.Int())
if horizon.Int() != 0 {
t.Errorf("Unexpected horizon value, got:%d expect:0", horizon.Int())
}
w.AddQuadSet(makeQuadSet())
@ -182,8 +182,8 @@ func TestLoadDatabase(t *testing.T) {
t.Errorf("Unexpected quadstore size, got:%d expect:5", s)
}
horizon = qs.Horizon()
if horizon.Int() != 12 {
t.Errorf("Unexpected horizon value, got:%d expect:12", horizon.Int())
if horizon.Int() != 11 {
t.Errorf("Unexpected horizon value, got:%d expect:11", horizon.Int())
}
w.RemoveQuad(quad.Quad{

View file

@ -31,7 +31,6 @@ import (
"github.com/google/cayley/graph"
"github.com/google/cayley/graph/iterator"
"github.com/google/cayley/keys"
"github.com/google/cayley/quad"
)
@ -49,7 +48,6 @@ var (
New: func() interface{} { return sha1.New() },
}
hashSize = sha1.Size
)
type Token []byte
@ -137,7 +135,7 @@ func (qs *QuadStore) Size() int64 {
}
func (qs *QuadStore) Horizon() graph.PrimaryKey {
return keys.NewSequentialKey(qs.horizon)
return graph.NewSequentialKey(qs.horizon)
}
func hashOf(s string) []byte {