2020-12-06 11:05:46 +13:00
|
|
|
package database
|
|
|
|
|
|
|
|
import (
|
2020-12-06 12:21:09 +13:00
|
|
|
"demodesk/neko/internal/session/database/dummy"
|
2020-12-07 05:28:15 +13:00
|
|
|
"demodesk/neko/internal/session/database/file"
|
2020-12-06 12:21:09 +13:00
|
|
|
"demodesk/neko/internal/session/database/object"
|
2020-12-06 11:05:46 +13:00
|
|
|
"demodesk/neko/internal/types"
|
2020-12-06 12:21:09 +13:00
|
|
|
"demodesk/neko/internal/config"
|
2020-12-06 11:05:46 +13:00
|
|
|
)
|
|
|
|
|
2020-12-06 12:21:09 +13:00
|
|
|
func New(config *config.Session) types.MembersDatabase {
|
2020-12-07 05:28:15 +13:00
|
|
|
switch config.DatabaseAdapter {
|
|
|
|
case "file":
|
|
|
|
return file.New(config.FilePath)
|
2020-12-06 12:21:09 +13:00
|
|
|
case "object":
|
|
|
|
return object.New()
|
|
|
|
case "dummy":
|
|
|
|
return dummy.New()
|
2020-12-06 11:05:46 +13:00
|
|
|
}
|
|
|
|
|
2020-12-06 12:21:09 +13:00
|
|
|
return dummy.New()
|
2020-12-06 11:05:46 +13:00
|
|
|
}
|