update the registration interface
This commit is contained in:
parent
9155dc0c56
commit
ba5b1dbfc3
4 changed files with 30 additions and 6 deletions
|
|
@ -33,7 +33,13 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
graph.RegisterQuadStore("bolt", true, newQuadStore, createNewBolt, nil)
|
||||
graph.RegisterQuadStore(QuadStoreType, graph.QuadStoreRegistration{
|
||||
NewFunc: newQuadStore,
|
||||
NewForRequestFunc: nil,
|
||||
UpgradeFunc: nil,
|
||||
InitFunc: createNewBolt,
|
||||
IsPersistent: true,
|
||||
})
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
|
|
@ -35,7 +35,13 @@ import (
|
|||
)
|
||||
|
||||
func init() {
|
||||
graph.RegisterQuadStore(QuadStoreType, true, newQuadStore, createNewLevelDB, nil)
|
||||
graph.RegisterQuadStore(QuadStoreType, graph.QuadStoreRegistration{
|
||||
NewFunc: newQuadStore,
|
||||
NewForRequestFunc: nil,
|
||||
UpgradeFunc: nil,
|
||||
InitFunc: createNewLevelDB,
|
||||
IsPersistent: true,
|
||||
})
|
||||
}
|
||||
|
||||
const (
|
||||
|
|
|
|||
|
|
@ -30,9 +30,15 @@ import (
|
|||
const QuadStoreType = "memstore"
|
||||
|
||||
func init() {
|
||||
graph.RegisterQuadStore(QuadStoreType, false, func(string, graph.Options) (graph.QuadStore, error) {
|
||||
return newQuadStore(), nil
|
||||
}, nil, nil)
|
||||
graph.RegisterQuadStore(QuadStoreType, graph.QuadStoreRegistration{
|
||||
NewFunc: func(string, graph.Options) (graph.QuadStore, error) {
|
||||
return newQuadStore(), nil
|
||||
},
|
||||
NewForRequestFunc: nil,
|
||||
UpgradeFunc: nil,
|
||||
InitFunc: nil,
|
||||
IsPersistent: false,
|
||||
})
|
||||
}
|
||||
|
||||
func cmp(a, b int64) int {
|
||||
|
|
|
|||
|
|
@ -34,7 +34,13 @@ const DefaultDBName = "cayley"
|
|||
const QuadStoreType = "mongo"
|
||||
|
||||
func init() {
|
||||
graph.RegisterQuadStore(QuadStoreType, true, newQuadStore, createNewMongoGraph, nil)
|
||||
graph.RegisterQuadStore(QuadStoreType, graph.QuadStoreRegistration{
|
||||
NewFunc: newQuadStore,
|
||||
NewForRequestFunc: nil,
|
||||
UpgradeFunc: nil,
|
||||
InitFunc: createNewMongoGraph,
|
||||
IsPersistent: true,
|
||||
})
|
||||
}
|
||||
|
||||
var (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue