From ee2da2be9d32426b7ab113005e417837b0ae5a1c Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Thu, 22 Jun 2023 17:10:04 +0200 Subject: Add serialisation of ServerAddress ... in a way consistent with what we're using at other places already. --- src/buildtool/execution_api/remote/config.hpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/buildtool/execution_api/remote/config.hpp') diff --git a/src/buildtool/execution_api/remote/config.hpp b/src/buildtool/execution_api/remote/config.hpp index b10c3b23..0b028035 100644 --- a/src/buildtool/execution_api/remote/config.hpp +++ b/src/buildtool/execution_api/remote/config.hpp @@ -23,6 +23,9 @@ #include #include +#include +#include + #include "gsl/gsl" #include "src/buildtool/logging/logger.hpp" #include "src/utils/cpp/type_safe_arithmetic.hpp" @@ -61,6 +64,10 @@ class RemoteExecutionConfig { struct ServerAddress { std::string host{}; Port port{}; + + [[nodiscard]] auto ToJson() const noexcept -> nlohmann::json { + return nlohmann::json{fmt::format("{}:{}", host, port)}; + } }; // Obtain global instance -- cgit v1.2.3