#pragma once #include "LauncherUtils.h" #include "client/mgmtd/MgmtdClient.h" #include "common/net/Client.h" namespace hf3fs::core::launcher { struct MgmtdClientFetcher { MgmtdClientFetcher(String clusterId, const net::Client::Config &clientCfg, const client::MgmtdClient::Config &mgmtdClientCfg); template MgmtdClientFetcher(const ConfigT &cfg) : MgmtdClientFetcher(cfg.cluster_id(), cfg.client(), cfg.mgmtd_client()) {} virtual ~MgmtdClientFetcher() { stopClient(); } Result loadConfigTemplate(flat::NodeType nodeType); Result ensureClientInited(); void stopClient(); virtual Result completeAppInfo(flat::AppInfo &appInfo) = 0; const String clusterId_; const net::Client::Config &clientCfg_; const client::MgmtdClient::Config &mgmtdClientCfg_; std::unique_ptr client_; std::shared_ptr mgmtdClient_; }; } // namespace hf3fs::core::launcher