initial commit

This commit is contained in:
Arnaud Delcasse
2025-10-08 09:09:53 +02:00
commit efccea3f64
16 changed files with 2780 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
package storage
import (
"fmt"
"github.com/spf13/viper"
)
func NewStorage(cfg *viper.Viper) (Storage, error) {
storage_type := cfg.GetString("storage.db.type")
switch storage_type {
case "mongodb":
return NewMongoDBStorageFromConfig(cfg)
case "mock":
return NewMockStorage(), nil
default:
return nil, fmt.Errorf("storage type %v is not supported", storage_type)
}
}