renamed GetType() to Type(), fixed iterator tests

This commit is contained in:
= 2014-12-01 13:36:32 +01:00 committed by panamafrancis
parent 4bafc22f43
commit d545fc4b44
7 changed files with 9 additions and 7 deletions

View file

@ -520,6 +520,6 @@ func (qs *QuadStore) FixedIterator() graph.FixedIterator {
return iterator.NewFixed(compareTokens)
}
func (qs *QuadStore) GetType() string {
func (qs *QuadStore) Type() string {
return QuadStoreType
}

View file

@ -548,6 +548,6 @@ func (qs *QuadStore) hashOf(s string, hasher hash.Hash) string {
return hex.EncodeToString(key)
}
func (qs *QuadStore) GetType() string {
func (qs *QuadStore) Type() string {
return QuadStoreType
}

View file

@ -73,3 +73,5 @@ func (qs *store) Close() {}
func (qs *store) QuadDirection(graph.Value, quad.Direction) graph.Value { return 0 }
func (qs *store) RemoveQuad(t quad.Quad) {}
func (qs *store) Type() string { return "mockstore" }

View file

@ -497,6 +497,6 @@ func (qs *QuadStore) FixedIterator() graph.FixedIterator {
return iterator.NewFixed(compareBytes)
}
func (qs *QuadStore) GetType() string {
func (qs *QuadStore) Type() string {
return QuadStoreType
}

View file

@ -273,6 +273,6 @@ func (qs *QuadStore) NodesAllIterator() graph.Iterator {
func (qs *QuadStore) Close() {}
func (qs *QuadStore) GetType() string {
func (qs *QuadStore) Type() string {
return QuadStoreType
}

View file

@ -368,6 +368,6 @@ func (qs *QuadStore) QuadDirection(in graph.Value, d quad.Direction) graph.Value
// TODO(barakmich): Rewrite bulk loader. For now, iterating around blocks is the way we'll go about it.
func (qs *QuadStore) GetType() string {
func (qs *QuadStore) Type() string {
return QuadStoreType
}

View file

@ -98,7 +98,7 @@ type QuadStore interface {
// Get the type of QuadStore
//TODO replace this using reflection
GetType() string
Type() string
}
type Options map[string]interface{}
@ -190,7 +190,7 @@ func InitQuadStore(name, dbpath string, opts Options) error {
}
func NewQuadStoreForRequest(qs QuadStore, opts Options) (QuadStore, error) {
r, registered := storeRegistry[qs.GetType()]
r, registered := storeRegistry[qs.Type()]
if registered {
return r.newForRequestFunc(qs, opts)
}