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
@@ -8,6 +8,7 @@ import (
|
||||
"git.sendico.io/tech/sxchnge/shared/database/repository/builder"
|
||||
rd "git.sendico.io/tech/sxchnge/shared/database/repository/decoder"
|
||||
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/transaction"
|
||||
"go.mongodb.org/mongo-driver/v2/bson"
|
||||
"go.mongodb.org/mongo-driver/v2/mongo"
|
||||
@@ -53,6 +54,11 @@ type Repository interface {
|
||||
Collection() string
|
||||
}
|
||||
|
||||
func CreateRepository(db source.Source, collection string) Repository {
|
||||
return repositoryimp.NewRepository(db, collection)
|
||||
}
|
||||
|
||||
// CreateMongoRepository adapts an externally owned fixed database.
|
||||
func CreateMongoRepository(db *mongo.Database, collection string) Repository {
|
||||
return repositoryimp.NewMongoRepository(db, collection)
|
||||
return CreateRepository(source.Fixed(db), collection)
|
||||
}
|
||||
Reference in new issue
Block a user