renamed GetType() to Type(), fixed iterator tests
This commit is contained in:
parent
4bafc22f43
commit
d545fc4b44
7 changed files with 9 additions and 7 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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" }
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue