aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/storage/admin/admin.h
blob: ee3da45797afc7332eeff061290333733a8dfca2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include <zencore/compactbinary.h>
#include <zenhttp/httpserver.h>
#include <functional>

namespace zen {

class GcScheduler;
class JobQueue;
class ZenCacheStore;
struct ZenServerConfig;

class HttpAdminService : public zen::HttpService
{
public:
	struct LogPaths
	{
		std::filesystem::path AbsLogPath;
		std::filesystem::path HttpLogPath;
		std::filesystem::path CacheLogPath;
	};
	HttpAdminService(GcScheduler&			 Scheduler,
					 JobQueue&				 BackgroundJobQueue,
					 ZenCacheStore*			 CacheStore,
					 std::function<void()>&& FlushFunction,
					 const LogPaths&		 LogPaths,
					 const ZenServerConfig&	 ServerOptions);
	~HttpAdminService();

	virtual const char* BaseUri() const override;
	virtual void		HandleRequest(zen::HttpServerRequest& Request) override;

private:
	HttpRequestRouter	   m_Router;
	GcScheduler&		   m_GcScheduler;
	JobQueue&			   m_BackgroundJobQueue;
	ZenCacheStore*		   m_CacheStore;
	std::function<void()>  m_FlushFunction;
	LogPaths			   m_LogPaths;
	const ZenServerConfig& m_ServerOptions;
};

}  // namespace zen