cleaner tests i thought

This commit is contained in:
breel
2020-08-01 01:09:35 -06:00
parent baf0aaa287
commit 71b1de33ec
7 changed files with 141 additions and 141 deletions

View File

@@ -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...),
}
}