Exemplo n.º 1
0
func newStateCollection(collection mongo.Collection, envUUID string) mongo.Collection {
	if multiEnvCollections.Contains(collection.Name()) {
		return &envStateCollection{
			WriteCollection: collection.Writeable(),
			envUUID:         envUUID,
		}
	}
	return collection
}
Exemplo n.º 2
0
func newBinaryStorage(uuid string, metadataCollection mongo.Collection, txnRunner jujutxn.Runner) binarystorage.Storage {
	db := metadataCollection.Writeable().Underlying().Database
	rs := blobstore.NewGridFS(blobstoreDB, blobstoreDB, db.Session)
	managedStorage := blobstore.NewManagedStorage(db, rs)
	return binarystorageNew(uuid, managedStorage, metadataCollection, txnRunner)
}