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() {
|
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 (
|
var (
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,13 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
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 (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,15 @@ import (
|
||||||
const QuadStoreType = "memstore"
|
const QuadStoreType = "memstore"
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
graph.RegisterQuadStore(QuadStoreType, false, func(string, graph.Options) (graph.QuadStore, error) {
|
graph.RegisterQuadStore(QuadStoreType, graph.QuadStoreRegistration{
|
||||||
return newQuadStore(), nil
|
NewFunc: func(string, graph.Options) (graph.QuadStore, error) {
|
||||||
}, nil, nil)
|
return newQuadStore(), nil
|
||||||
|
},
|
||||||
|
NewForRequestFunc: nil,
|
||||||
|
UpgradeFunc: nil,
|
||||||
|
InitFunc: nil,
|
||||||
|
IsPersistent: false,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
func cmp(a, b int64) int {
|
func cmp(a, b int64) int {
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,13 @@ const DefaultDBName = "cayley"
|
||||||
const QuadStoreType = "mongo"
|
const QuadStoreType = "mongo"
|
||||||
|
|
||||||
func init() {
|
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 (
|
var (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue