INetworkClient loses the unused getAsync/postAsync/requestAsync (0 call-sites); ICoreInterface loses getQueueSummaries (0 call-sites). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.2 KiB
C++
46 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "Types.hpp"
|
|
#include <Void/Net/Http.hpp>
|
|
#include <future>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace Echoion::Api
|
|
{
|
|
|
|
// Network client interface. Speaks Void::Net types directly — there is no
|
|
// echoion-side HTTP/proxy mirror.
|
|
class INetworkClient
|
|
{
|
|
public:
|
|
|
|
virtual ~INetworkClient() = default;
|
|
|
|
// Initialize with optional proxy
|
|
virtual Result<void> initialize(
|
|
const std::optional<Void::Net::ProxyConfig>& proxy =
|
|
std::nullopt) = 0;
|
|
virtual void shutdown() = 0;
|
|
|
|
// Synchronous requests
|
|
[[nodiscard]] virtual Result<Void::Net::Response>
|
|
get(std::string_view url,
|
|
const std::vector<Void::Net::Header>& headers = {}) = 0;
|
|
[[nodiscard]] virtual Result<Void::Net::Response>
|
|
post(std::string_view url, std::string_view body,
|
|
const std::vector<Void::Net::Header>& headers = {}) = 0;
|
|
[[nodiscard]] virtual Result<Void::Net::Response>
|
|
request(const Void::Net::Request& req) = 0;
|
|
|
|
// Proxy configuration
|
|
virtual void
|
|
setProxy(const std::optional<Void::Net::ProxyConfig>& proxy) = 0;
|
|
[[nodiscard]] virtual std::optional<Void::Net::ProxyConfig>
|
|
getProxy() const = 0;
|
|
virtual void clearProxy() = 0;
|
|
};
|
|
|
|
} // namespace Echoion::Api
|