cleaner tests i thought
This commit is contained in:
@@ -3,11 +3,9 @@ package storage
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"local/dndex/config"
|
||||
"local/dndex/storage/driver"
|
||||
"local/dndex/storage/entity"
|
||||
"local/dndex/storage/operator"
|
||||
"strings"
|
||||
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
)
|
||||
@@ -16,16 +14,9 @@ type Graph struct {
|
||||
driver driver.Driver
|
||||
}
|
||||
|
||||
func NewGraph() Graph {
|
||||
var d driver.Driver
|
||||
switch strings.ToLower(config.New().DriverType) {
|
||||
case "mongo":
|
||||
d = driver.NewMongo()
|
||||
case "boltdb":
|
||||
d = driver.NewBoltDB()
|
||||
}
|
||||
func NewGraph(path ...string) Graph {
|
||||
return Graph{
|
||||
driver: d,
|
||||
driver: driver.New(path...),
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user