Refact0r
Some checks failed
Dropshell Test / Build_and_Test (push) Has been cancelled

This commit is contained in:
Your Name
2025-05-17 19:40:51 +12:00
parent 203068048d
commit 1d3bb634f0
17 changed files with 608 additions and 499 deletions

View File

@@ -3,27 +3,61 @@
#include "servers.hpp"
#include "command_registry.hpp"
#include "server_env_manager.hpp"
namespace dropshell {
namespace dropshell
{
namespace shared_commands
{
typedef enum HealthStatus
{
HEALTHY,
UNHEALTHY,
NOTINSTALLED,
ERROR,
UNKNOWN
} HealthStatus;
typedef struct ServiceStatus
{
HealthStatus health;
std::vector<int> ports;
} ServiceStatus;
// expose routines used by multiple commands.
class cRemoteTempFolder
{
public:
cRemoteTempFolder(const server_env_manager &server_env); // create a temp folder on the remote server
~cRemoteTempFolder(); // delete the temp folder on the remote server
std::string path() const; // get the path to the temp folder on the remote server
private:
std::string mPath;
const server_env_manager &mServerEnv;
};
// defined in install.cpp
bool rsync_tree_to_remote(
const std::string &local_path,
const std::string &remote_path,
server_env_manager &server_env,
const std::string &remote_path,
server_env_manager &server_env,
bool silent);
// defined in install.cpp
std::string get_arch();
// defined in health.cpp
std::string healthtick(const std::string& server, const std::string& service);
std::map<std::string, ServiceStatus> get_all_services_status(std::string server_name);
std::string healthtick(const std::string &server, const std::string &service);
std::string HealthStatus2String(HealthStatus status);
HealthStatus is_healthy(const std::string &server, const std::string &service);
std::string healthmark(const std::string &server, const std::string &service);
// defined in standard_autocomplete.cpp
void std_autocomplete(const CommandContext& ctx);
void std_autocomplete_allowall(const CommandContext& ctx);
void std_autocomplete(const CommandContext &ctx);
void std_autocomplete_allowall(const CommandContext &ctx);
} // namespace shared_commands
} // namespace dropshell
#endif