MCPcopy Create free account
hub / github.com/OpenArkStudio/ARK / GetKeyValue

Method GetKeyValue

src/plugin/consul/src/AFCConsulModule.cpp:44–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44ananas::Future<std::pair<bool, std::string>> AFCConsulModule::GetKeyValue(const std::string& key)
45{
46 ananas::Promise<std::pair<bool, std::string>> promise;
47 if (key.empty())
48 {
49 promise.SetValue(std::make_pair(false, std::string()));
50 return promise.GetFuture();
51 }
52
53 std::string url = KV_API + key;
54 return m_pHttpClientModule->AsyncRequest(
55 brynet::net::http::HttpRequest::HTTP_METHOD::HTTP_METHOD_GET, consul_ip_, consul_port_, url);
56}
57
58ananas::Future<std::pair<bool, std::string>> AFCConsulModule::SetKeyValue(
59 const std::string& key, const std::string& value)

Callers

nothing calls this directly

Calls 4

GetFutureMethod · 0.80
emptyMethod · 0.45
SetValueMethod · 0.45
AsyncRequestMethod · 0.45

Tested by

no test coverage detected