cleaner tests i thought
This commit is contained in:
@@ -15,12 +15,15 @@ type Driver interface {
|
||||
Delete(context.Context, string, interface{}) error
|
||||
}
|
||||
|
||||
func New() Driver {
|
||||
func New(path ...string) Driver {
|
||||
if len(path) == 0 {
|
||||
path = []string{config.New().DBURI}
|
||||
}
|
||||
switch strings.ToLower(config.New().DriverType) {
|
||||
case "mongo":
|
||||
return NewMongo()
|
||||
return NewMongo(path[0])
|
||||
case "boltdb":
|
||||
return NewBoltDB()
|
||||
return NewBoltDB(path[0])
|
||||
}
|
||||
panic("unknown driver type " + strings.ToLower(config.New().DriverType))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user