Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3261315
D4030.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.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
Sat, Nov 16, 11:00 PM (19 h, 25 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2506774
Default Alt Text
D4030.diff (1 KB)
Attached To
Mode
D4030: [services] Backup - Implement generating holder
Attached
Detach File
Event Timeline
Log In to Comment