aboutsummaryrefslogtreecommitdiff
path: root/zenserver/cache/structuredcache.h
diff options
context:
space:
mode:
Diffstat (limited to 'zenserver/cache/structuredcache.h')
-rw-r--r--zenserver/cache/structuredcache.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/zenserver/cache/structuredcache.h b/zenserver/cache/structuredcache.h
new file mode 100644
index 000000000..d0646e6e9
--- /dev/null
+++ b/zenserver/cache/structuredcache.h
@@ -0,0 +1,40 @@
+// Copyright Epic Games, Inc. All Rights Reserved.
+
+#pragma once
+
+#include <zencore/httpserver.h>
+
+#include "cachestore.h"
+#include "upstream/jupiter.h"
+
+namespace zen {
+
+/**
+ * New-style cache service. Imposes constraints on keys, supports blobs and
+ * structured values
+ */
+
+class HttpStructuredCacheService : public zen::HttpService
+{
+public:
+ HttpStructuredCacheService(std::filesystem::path RootPath, zen::CasStore& InStore);
+ ~HttpStructuredCacheService();
+
+ virtual const char* BaseUri() const override;
+
+ virtual void HandleRequest(zen::HttpServerRequest& Request) override;
+
+private:
+ struct CacheRef
+ {
+ std::string BucketSegment;
+ IoHash HashKey;
+ };
+
+ [[nodiscard]] bool ValidateUri(zen::HttpServerRequest& Request, CacheRef& OutRef);
+
+ zen::CasStore& m_CasStore;
+ ZenCacheStore m_CacheStore;
+};
+
+} // namespace zen