aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Boberg <[email protected]>2021-05-20 14:02:02 +0200
committerStefan Boberg <[email protected]>2021-05-20 14:02:02 +0200
commit949cf64f620529b3a943828333a176d2f3bfb494 (patch)
tree981397984bf520cafc0cd49dd790062db6e3f936
parentAdded HttpServerRequest::RequestContentType() (diff)
downloadzen-949cf64f620529b3a943828333a176d2f3bfb494.tar.xz
zen-949cf64f620529b3a943828333a176d2f3bfb494.zip
Added tentative Jupiter structured data endpoints
-rw-r--r--zenserver/upstream/jupiter.cpp22
-rw-r--r--zenserver/upstream/jupiter.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/zenserver/upstream/jupiter.cpp b/zenserver/upstream/jupiter.cpp
index 6b54f3d01..88a164fbd 100644
--- a/zenserver/upstream/jupiter.cpp
+++ b/zenserver/upstream/jupiter.cpp
@@ -110,6 +110,28 @@ CloudCacheSession::Put(std::string_view BucketId, std::string_view Key, IoBuffer
//////////////////////////////////////////////////////////////////////////
+IoBuffer
+CloudCacheSession::Get(std::string_view BucketId, const IoHash& Key)
+{
+ StringBuilder<64> KeyString;
+ Key.ToHexString(KeyString);
+
+ return Get(BucketId, KeyString);
+}
+
+void
+CloudCacheSession::Put(std::string_view BucketId, const IoHash& Key, IoBuffer Data, HttpContentType ContentType)
+{
+ ZEN_UNUSED(ContentType);
+
+ StringBuilder<64> KeyString;
+ Key.ToHexString(KeyString);
+
+ return Put(BucketId, KeyString, Data);
+}
+
+//////////////////////////////////////////////////////////////////////////
+
std::string
CloudCacheAccessToken::GetAuthorizationHeaderValue()
{
diff --git a/zenserver/upstream/jupiter.h b/zenserver/upstream/jupiter.h
index dd01cfb86..c17ffb047 100644
--- a/zenserver/upstream/jupiter.h
+++ b/zenserver/upstream/jupiter.h
@@ -2,6 +2,7 @@
#pragma once
+#include <zencore/httpserver.h>
#include <zencore/refcount.h>
#include <zencore/thread.h>
@@ -47,9 +48,14 @@ public:
CloudCacheSession(CloudCacheClient* OuterClient);
~CloudCacheSession();
+ // Key-value cache operations
IoBuffer Get(std::string_view BucketId, std::string_view Key);
void Put(std::string_view BucketId, std::string_view Key, IoBuffer Data);
+ // Structured cache operations
+ IoBuffer Get(std::string_view BucketId, const IoHash& Key);
+ void Put(std::string_view BucketId, const IoHash& Key, IoBuffer Data, HttpContentType ContentType);
+
private:
RefPtr<CloudCacheClient> m_CacheClient;
detail::CloudCacheSessionState* m_SessionState;