comment tweaks
This commit is contained in:
parent
fb3e181a62
commit
923679b36c
3 changed files with 5 additions and 5 deletions
|
|
@ -27,7 +27,7 @@ import (
|
||||||
"github.com/google/cayley/graph"
|
"github.com/google/cayley/graph"
|
||||||
"github.com/google/cayley/http"
|
"github.com/google/cayley/http"
|
||||||
|
|
||||||
// load all supported backends
|
// Load all supported backends.
|
||||||
_ "github.com/google/cayley/graph/leveldb"
|
_ "github.com/google/cayley/graph/leveldb"
|
||||||
_ "github.com/google/cayley/graph/memstore"
|
_ "github.com/google/cayley/graph/memstore"
|
||||||
_ "github.com/google/cayley/graph/mongo"
|
_ "github.com/google/cayley/graph/mongo"
|
||||||
|
|
|
||||||
|
|
@ -26,10 +26,9 @@ func Open(cfg *config.Config) graph.TripleStore {
|
||||||
ts, err := graph.NewTripleStore(cfg.DatabaseType, cfg.DatabasePath, cfg.DatabaseOptions)
|
ts, err := graph.NewTripleStore(cfg.DatabaseType, cfg.DatabasePath, cfg.DatabaseOptions)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
glog.Fatalln(err.Error())
|
glog.Fatalln(err.Error())
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// memstore is not persistent, so MUST be loaded
|
// Memstore is not persistent, so it MUST be loaded.
|
||||||
if cfg.DatabaseType == "memstore" {
|
if cfg.DatabaseType == "memstore" {
|
||||||
Load(ts, cfg, cfg.DatabasePath)
|
Load(ts, cfg, cfg.DatabasePath)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -163,9 +163,10 @@ func InitTripleStore(name, dbpath string, opts Options) error {
|
||||||
return errors.New("triplestore: name '" + name + "' is not registered")
|
return errors.New("triplestore: name '" + name + "' is not registered")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TripleStores() (t []string) {
|
func TripleStores() []string {
|
||||||
|
t := make([]string, 0, len(storeRegistry))
|
||||||
for n := range storeRegistry {
|
for n := range storeRegistry {
|
||||||
t = append(t, n)
|
t = append(t, n)
|
||||||
}
|
}
|
||||||
return
|
return t
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue