Extend PostgreSQL implementation and unit tests on MongoDB storage
This commit is contained in:
@@ -30,11 +30,15 @@ func NewStorage(cfg *viper.Viper) (Storage, error) {
|
||||
|
||||
type DBStorage interface {
|
||||
GetAccount(id string) (*Account, error)
|
||||
LocalAuthentication(namespace string, username string, email string, phone_number string) (*Account, error)
|
||||
LocalAuthentication(namespace string, username *string, email *string, phone_number *string) (*Account, error)
|
||||
GetAccounts(namespaces []string) ([]Account, error)
|
||||
GetAccountsByIds(accountids []string) ([]Account, error)
|
||||
CreateAccount(account Account) error
|
||||
|
||||
//TODO : remove UpdateAccount, implement UpdateAccountData and UpdateAccountLocalAuthentication
|
||||
UpdateAccount(account Account) error
|
||||
|
||||
Migrate() error
|
||||
}
|
||||
|
||||
func NewDBStorage(cfg *viper.Viper) (DBStorage, error) {
|
||||
@@ -66,3 +70,7 @@ func NewKVStore(cfg *viper.Viper) (KVStore, error) {
|
||||
kv, err := NewEtcdKVStore(cfg)
|
||||
return kv, err
|
||||
}
|
||||
|
||||
func Ptr[T any](v T) *T {
|
||||
return &v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user