| 42 | } |
| 43 | |
| 44 | ananas::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 | |
| 58 | ananas::Future<std::pair<bool, std::string>> AFCConsulModule::SetKeyValue( |
| 59 | const std::string& key, const std::string& value) |
nothing calls this directly
no test coverage detected