#include <HttpServer.h>
|
| | HttpServer (std::shared_ptr< SessionManager > session_manager, fs::path root_folder, fs::path user_directory, std::string auth_token, bool read_only_mode=false, bool enable_frontend=true, bool enable_database=true, bool enable_scripting=false, bool enable_runtime_config=true, std::string url_prefix="") |
| |
| bool | CanServeFrontend () |
| |
| void | RegisterRoutes () |
| |
|
| nlohmann::json | GetExistingPreferences () |
| |
| std::string_view | UpdatePreferencesFromString (const std::string &buffer) |
| |
| std::string_view | ClearPreferencesFromString (const std::string &buffer) |
| |
| nlohmann::json | GetExistingObjectList (const std::string &object_type) |
| |
| nlohmann::json | GetObjectFromPath (const fs::path &path, const std::string &object_type) |
| |
| nlohmann::json | GetExistingObjects (const std::string &object_type) |
| |
| nlohmann::json | GetExistingObject (const std::string &object_type, const std::string &object_name) |
| |
| std::string_view | SetObjectFromString (const std::string &object_type, const std::string &buffer) |
| |
| std::string_view | ClearObjectFromString (const std::string &object_type, const std::string &buffer) |
| |
| std::string_view | SendScriptingRequest (const std::string &buffer, int &session_id, ScriptingResponseCallback callback, ScriptingSessionClosedCallback session_closed_callback, ScriptingRequestHandler request_handler) |
| |
| std::string_view | OnScriptingResponse (std::string &response_buffer, const bool &success, const std::string &message, const std::string &response) |
| |
| void | OnScriptingAbort (int session_id, uint32_t scripting_request_id) |
| |
|
| bool | IsAuthenticated (Req *req) |
| |
| void | AddNoCacheHeaders (Res *res) |
| |
| void | AddCorsHeaders (Res *res) |
| |
| void | NormalisePreferences (nlohmann::json &obj) |
| |
| bool | ValidatePreferences (nlohmann::json &obj) |
| |
| bool | ValidateObject (const std::string &object_type, nlohmann::json &obj) |
| |
| bool | WritePreferencesFile (nlohmann::json &obj) |
| |
| void | WritePreferencesBackup () |
| |
| bool | WriteObjectFile (const std::string &object_type, const std::string &object_name, nlohmann::json &obj) |
| |
| void | WaitForData (Res *res, Req *req, const std::function< void(const std::string &)> &callback) |
| |
| void | HandleStaticRequest (Res *res, Req *req) |
| |
| void | HandleGetConfig (Res *res, Req *req) |
| |
| void | HandleGetPreferences (Res *res, Req *req) |
| |
| void | HandleSetPreferences (Res *res, Req *req) |
| |
| void | HandleClearPreferences (Res *res, Req *req) |
| |
| void | HandleGetObjectList (const std::string &object_type, Res *res, Req *req) |
| |
| void | HandleGetObject (const std::string &object_type, Res *res, Req *req) |
| |
| void | HandleGetObjects (const std::string &object_type, Res *res, Req *req) |
| |
| void | HandleSetObject (const std::string &object_type, Res *res, Req *req) |
| |
| void | HandleClearObject (const std::string &object_type, Res *res, Req *req) |
| |
| void | HandleScriptingAction (Res *res, Req *req) |
| |
| void | NotImplemented (Res *res, Req *req) |
| |
| void | DefaultSuccess (Res *res, Req *req) |
| |
◆ HttpServer()
| carta::HttpServer::HttpServer |
( |
std::shared_ptr< SessionManager > |
session_manager, |
|
|
fs::path |
root_folder, |
|
|
fs::path |
user_directory, |
|
|
std::string |
auth_token, |
|
|
bool |
read_only_mode = false, |
|
|
bool |
enable_frontend = true, |
|
|
bool |
enable_database = true, |
|
|
bool |
enable_scripting = false, |
|
|
bool |
enable_runtime_config = true, |
|
|
std::string |
url_prefix = "" |
|
) |
| |
◆ AddCorsHeaders()
| void carta::HttpServer::AddCorsHeaders |
( |
Res * |
res | ) |
|
|
private |
◆ AddNoCacheHeaders()
| void carta::HttpServer::AddNoCacheHeaders |
( |
Res * |
res | ) |
|
|
private |
◆ CanServeFrontend()
| bool carta::HttpServer::CanServeFrontend |
( |
| ) |
|
|
inline |
◆ ClearObjectFromString()
| std::string_view carta::HttpServer::ClearObjectFromString |
( |
const std::string & |
object_type, |
|
|
const std::string & |
buffer |
|
) |
| |
|
protected |
◆ ClearPreferencesFromString()
| std::string_view carta::HttpServer::ClearPreferencesFromString |
( |
const std::string & |
buffer | ) |
|
|
protected |
◆ DefaultSuccess()
| void carta::HttpServer::DefaultSuccess |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ GetExistingObject()
| nlohmann::json carta::HttpServer::GetExistingObject |
( |
const std::string & |
object_type, |
|
|
const std::string & |
object_name |
|
) |
| |
|
protected |
◆ GetExistingObjectList()
| nlohmann::json carta::HttpServer::GetExistingObjectList |
( |
const std::string & |
object_type | ) |
|
|
protected |
◆ GetExistingObjects()
| nlohmann::json carta::HttpServer::GetExistingObjects |
( |
const std::string & |
object_type | ) |
|
|
protected |
◆ GetExistingPreferences()
| json carta::HttpServer::GetExistingPreferences |
( |
| ) |
|
|
protected |
◆ GetFileUrlString()
| std::string carta::HttpServer::GetFileUrlString |
( |
std::vector< std::string > |
files | ) |
|
|
static |
◆ GetObjectFromPath()
| nlohmann::json carta::HttpServer::GetObjectFromPath |
( |
const fs::path & |
path, |
|
|
const std::string & |
object_type |
|
) |
| |
|
protected |
◆ HandleClearObject()
| void carta::HttpServer::HandleClearObject |
( |
const std::string & |
object_type, |
|
|
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleClearPreferences()
| void carta::HttpServer::HandleClearPreferences |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleGetConfig()
| void carta::HttpServer::HandleGetConfig |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleGetObject()
| void carta::HttpServer::HandleGetObject |
( |
const std::string & |
object_type, |
|
|
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleGetObjectList()
| void carta::HttpServer::HandleGetObjectList |
( |
const std::string & |
object_type, |
|
|
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleGetObjects()
| void carta::HttpServer::HandleGetObjects |
( |
const std::string & |
object_type, |
|
|
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleGetPreferences()
| void carta::HttpServer::HandleGetPreferences |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleScriptingAction()
| void carta::HttpServer::HandleScriptingAction |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleSetObject()
| void carta::HttpServer::HandleSetObject |
( |
const std::string & |
object_type, |
|
|
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleSetPreferences()
| void carta::HttpServer::HandleSetPreferences |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ HandleStaticRequest()
| void carta::HttpServer::HandleStaticRequest |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ IsAuthenticated()
| bool carta::HttpServer::IsAuthenticated |
( |
Req * |
req | ) |
|
|
private |
◆ IsValidFrontendFolder()
| bool carta::HttpServer::IsValidFrontendFolder |
( |
fs::path |
folder | ) |
|
|
staticprivate |
◆ NormalisePreferences()
| void carta::HttpServer::NormalisePreferences |
( |
nlohmann::json & |
obj | ) |
|
|
private |
◆ NotImplemented()
| void carta::HttpServer::NotImplemented |
( |
Res * |
res, |
|
|
Req * |
req |
|
) |
| |
|
private |
◆ OnScriptingAbort()
| void carta::HttpServer::OnScriptingAbort |
( |
int |
session_id, |
|
|
uint32_t |
scripting_request_id |
|
) |
| |
|
protected |
◆ OnScriptingResponse()
| std::string_view carta::HttpServer::OnScriptingResponse |
( |
std::string & |
response_buffer, |
|
|
const bool & |
success, |
|
|
const std::string & |
message, |
|
|
const std::string & |
response |
|
) |
| |
|
protected |
◆ RegisterRoutes()
| void carta::HttpServer::RegisterRoutes |
( |
| ) |
|
◆ SendScriptingRequest()
◆ SetObjectFromString()
| std::string_view carta::HttpServer::SetObjectFromString |
( |
const std::string & |
object_type, |
|
|
const std::string & |
buffer |
|
) |
| |
|
protected |
◆ UpdatePreferencesFromString()
| std::string_view carta::HttpServer::UpdatePreferencesFromString |
( |
const std::string & |
buffer | ) |
|
|
protected |
◆ ValidateObject()
| bool carta::HttpServer::ValidateObject |
( |
const std::string & |
object_type, |
|
|
nlohmann::json & |
obj |
|
) |
| |
|
private |
◆ ValidatePreferences()
| bool carta::HttpServer::ValidatePreferences |
( |
nlohmann::json & |
obj | ) |
|
|
private |
◆ WaitForData()
| void carta::HttpServer::WaitForData |
( |
Res * |
res, |
|
|
Req * |
req, |
|
|
const std::function< void(const std::string &)> & |
callback |
|
) |
| |
|
private |
◆ WriteObjectFile()
| bool carta::HttpServer::WriteObjectFile |
( |
const std::string & |
object_type, |
|
|
const std::string & |
object_name, |
|
|
nlohmann::json & |
obj |
|
) |
| |
|
private |
◆ WritePreferencesBackup()
| void carta::HttpServer::WritePreferencesBackup |
( |
| ) |
|
|
private |
◆ WritePreferencesFile()
| bool carta::HttpServer::WritePreferencesFile |
( |
nlohmann::json & |
obj | ) |
|
|
private |
◆ _auth_token
| std::string carta::HttpServer::_auth_token |
|
private |
◆ _config_folder
| fs::path carta::HttpServer::_config_folder |
|
private |
◆ _enable_database
| bool carta::HttpServer::_enable_database |
|
private |
◆ _enable_frontend
| bool carta::HttpServer::_enable_frontend |
|
private |
◆ _enable_runtime_config
| bool carta::HttpServer::_enable_runtime_config |
|
private |
◆ _enable_scripting
| bool carta::HttpServer::_enable_scripting |
|
private |
◆ _frontend_found
| bool carta::HttpServer::_frontend_found |
|
private |
◆ _http_root_folder
| fs::path carta::HttpServer::_http_root_folder |
|
private |
◆ _read_only_mode
| bool carta::HttpServer::_read_only_mode |
|
private |
◆ _scripting_request_id
| uint32_t carta::HttpServer::_scripting_request_id = 0 |
|
staticprivate |
◆ _session_manager
◆ _url_prefix
| std::string carta::HttpServer::_url_prefix |
|
private |
The documentation for this class was generated from the following files: