working commit

This commit is contained in:
Олег Бородин
2026-05-21 14:15:03 +02:00
parent 3f7cfcd234
commit 5a2985f936
9 changed files with 185 additions and 16 deletions
+28 -5
View File
@@ -5,19 +5,42 @@
#include <uxlogger.hpp>
#include <uxclient.hpp>
#include <cliconfig.hpp>
#include <defines.hpp>
std::expected<void, std::string> Run(void) {
ClientConfig config;
std::string confdir(SRV_CONFDIR);
auto readRes = config.Read(confdir + "/" + "helmetcli.conf");
if (!readRes) {
return std::unexpected("Read config error: " + readRes.error());
}
auto validateRes = config.Validate();
if (!validateRes) {
return std::unexpected("Validate config error: " + validateRes.error());
}
auto servaddr = config.Servaddr();
auto servport = config.Servport();
auto localnets = config.Localnets();
int main(int argc, char** argv) {
UxClient client;
auto connectRes = client.Connect("127.0.0.1", 1025);
auto connectRes = client.Connect(servaddr, servport);
if (!connectRes) {
uxlogger.Error(connectRes.error());
return 1;
return std::unexpected(connectRes.error());
}
auto runRes = client.Run();
if (!runRes) {
return std::unexpected(runRes.error());
}
return {};
}
int main(int argc, char** argv) {
auto runRes = Run();
if (!runRes) {
uxlogger.Error(runRes.error());
return 1;
}
}