make map driver type for faster tests

This commit is contained in:
breel
2020-08-01 20:33:44 -06:00
parent b28bc74f8b
commit 37fe9415e7
13 changed files with 494 additions and 332 deletions

View File

@@ -9,6 +9,7 @@ import (
)
type Driver interface {
Count(context.Context, string, interface{}) (int, error)
Find(context.Context, string, interface{}) (chan bson.Raw, error)
Update(context.Context, string, interface{}, interface{}) error
Insert(context.Context, string, interface{}) error
@@ -20,6 +21,8 @@ func New(path ...string) Driver {
path = []string{config.New().DBURI}
}
switch strings.ToLower(config.New().DriverType) {
case "map":
return NewMap()
case "mongo":
return NewMongo(path[0])
case "boltdb":