diff options
| author | Stefan Boberg <[email protected]> | 2021-05-20 14:22:06 +0200 |
|---|---|---|
| committer | Stefan Boberg <[email protected]> | 2021-05-20 14:22:06 +0200 |
| commit | 1cf2d9c75615b5fcbcfa98c85330ed1ff5c13868 (patch) | |
| tree | e56530cf1f7d7816aa4f7c308ce1720522eace80 /zenserver/upstream | |
| parent | Attempt at fixing github diff view for 4-space tabs (diff) | |
| parent | Merged from master (diff) | |
| download | zen-1cf2d9c75615b5fcbcfa98c85330ed1ff5c13868.tar.xz zen-1cf2d9c75615b5fcbcfa98c85330ed1ff5c13868.zip | |
Merge branch 'main' of https://github.com/EpicGames/zen
Diffstat (limited to 'zenserver/upstream')
| -rw-r--r-- | zenserver/upstream/jupiter.cpp | 22 | ||||
| -rw-r--r-- | zenserver/upstream/jupiter.h | 12 |
2 files changed, 31 insertions, 3 deletions
diff --git a/zenserver/upstream/jupiter.cpp b/zenserver/upstream/jupiter.cpp index 523ee61f4..1078e5240 100644 --- a/zenserver/upstream/jupiter.cpp +++ b/zenserver/upstream/jupiter.cpp @@ -150,6 +150,28 @@ CloudCacheSession::Filter(std::string_view BucketId, const std::vector<IoHash>& ////////////////////////////////////////////////////////////////////////// +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 5bcec2904..2f01b7afb 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> @@ -49,9 +50,14 @@ public: CloudCacheSession(CloudCacheClient* OuterClient); ~CloudCacheSession(); - IoBuffer Get(std::string_view BucketId, std::string_view Key); - void Put(std::string_view BucketId, std::string_view Key, IoBuffer Data); - void Put(std::string_view BucketId, std::string_view Key, CbObjectView Data); + // 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); + std::vector<IoHash> Filter(std::string_view BucketId, const std::vector<IoHash>& ChunkHashes); private: |