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