neko/internal/session/database/manager.go

23 lines
481 B
Go
Raw Normal View History

2020-12-06 11:05:46 +13:00
package database
import (
2021-02-15 02:40:17 +13:00
"demodesk/neko/internal/config"
"demodesk/neko/internal/session/database/dummy"
2020-12-07 05:28:15 +13:00
"demodesk/neko/internal/session/database/file"
"demodesk/neko/internal/session/database/object"
2020-12-06 11:05:46 +13:00
"demodesk/neko/internal/types"
)
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)
case "object":
return object.New()
case "dummy":
return dummy.New()
2020-12-06 11:05:46 +13:00
}
return dummy.New()
2020-12-06 11:05:46 +13:00
}