2021-03-14 13:08:50 +13:00
|
|
|
package member
|
|
|
|
|
|
|
|
import (
|
|
|
|
"demodesk/neko/internal/config"
|
|
|
|
"demodesk/neko/internal/member/dummy"
|
|
|
|
"demodesk/neko/internal/member/file"
|
|
|
|
"demodesk/neko/internal/member/object"
|
|
|
|
"demodesk/neko/internal/types"
|
|
|
|
)
|
|
|
|
|
|
|
|
func New(config *config.Member) types.MemberManager {
|
|
|
|
switch config.Provider {
|
|
|
|
case "file":
|
2021-03-15 01:07:03 +13:00
|
|
|
return file.New(file.Config{
|
|
|
|
File: config.FilePath,
|
|
|
|
})
|
2021-03-14 13:08:50 +13:00
|
|
|
case "object":
|
2021-03-15 01:07:03 +13:00
|
|
|
return object.New(object.Config{
|
|
|
|
AdminPassword: config.AdminPassword,
|
|
|
|
UserPassword: config.Password,
|
|
|
|
})
|
2021-03-14 13:08:50 +13:00
|
|
|
case "dummy":
|
|
|
|
return dummy.New()
|
|
|
|
}
|
|
|
|
|
|
|
|
return dummy.New()
|
|
|
|
}
|