Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3266039
D4030.id12943.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D4030.id12943.diff
View Options
diff --git a/services/backup/src/Tools.h b/services/backup/src/Tools.h
--- a/services/backup/src/Tools.h
+++ b/services/backup/src/Tools.h
@@ -7,5 +7,10 @@
std::string generateRandomString(std::size_t length = 20);
+std::string generateHolder(
+ const std::string &blobHash,
+ const std::string &backupID,
+ const std::string &resourceID = "");
+
} // namespace network
} // namespace comm
diff --git a/services/backup/src/Tools.cpp b/services/backup/src/Tools.cpp
--- a/services/backup/src/Tools.cpp
+++ b/services/backup/src/Tools.cpp
@@ -1,5 +1,7 @@
#include "Tools.h"
+#include "GlobalTools.h"
+
#include <chrono>
#include <cstdlib>
#include <random>
@@ -19,5 +21,13 @@
return random_string;
}
+std::string generateHolder(
+ const std::string &blobHash,
+ const std::string &backupID,
+ const std::string &resourceID) {
+ return backupID + ID_SEPARATOR + resourceID + ID_SEPARATOR + blobHash +
+ ID_SEPARATOR + generateUUID();
+}
+
} // namespace network
} // namespace comm
diff --git a/services/lib/src/GlobalTools.h b/services/lib/src/GlobalTools.h
--- a/services/lib/src/GlobalTools.h
+++ b/services/lib/src/GlobalTools.h
@@ -6,6 +6,8 @@
namespace comm {
namespace network {
+const std::string ID_SEPARATOR = ":";
+
uint64_t getCurrentTimestamp();
bool hasEnvFlag(const std::string &flag);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 1:39 AM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2506774
Default Alt Text
D4030.id12943.diff (1 KB)
Attached To
Mode
D4030: [services] Backup - Implement generating holder
Attached
Detach File
Event Timeline
Log In to Comment