Keep Mongo operations online across Vault credential rotation
This commit is contained in:
1 parent
80d6917aa7
commit
23f7b78c3b
30 files changed
+1290
-202
No files matched your search
@@ -1,14 +1,14 @@
|
||||
package accountdb
|
||||
|
||||
import (
|
||||
customermodel "git.sendico.io/tech/sxchnge/product/customers/model"
|
||||
"strings"
|
||||
|
||||
customermodel "git.sendico.io/tech/sxchnge/product/customers/model"
|
||||
ri "git.sendico.io/tech/sxchnge/shared/database/repository/index"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/source"
|
||||
"git.sendico.io/tech/sxchnge/shared/database/template"
|
||||
"git.sendico.io/tech/sxchnge/shared/logging"
|
||||
"git.sendico.io/tech/sxchnge/shared/service"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -16,11 +16,11 @@ type AccountDB struct {
|
||||
template.DBImp[*customermodel.Account]
|
||||
}
|
||||
|
||||
func Create(logger mlogger.Logger, db *mongo.Database) (*AccountDB, error) {
|
||||
func Create(logger mlogger.Logger, db source.Source) (*AccountDB, error) {
|
||||
return CreateWithCollection(logger, db, mservice.Accounts)
|
||||
}
|
||||
|
||||
func CreateWithCollection(logger mlogger.Logger, db *mongo.Database, collection string) (*AccountDB, error) {
|
||||
func CreateWithCollection(logger mlogger.Logger, db source.Source, collection string) (*AccountDB, error) {
|
||||
if normalized := strings.TrimSpace(collection); normalized != "" {
|
||||
collection = normalized
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user