]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/push/src/curl_wrapper.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / prometheus-cpp / push / src / curl_wrapper.h
diff --git a/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/push/src/curl_wrapper.h b/ceph/src/jaegertracing/opentelemetry-cpp/third_party/prometheus-cpp/push/src/curl_wrapper.h
new file mode 100644 (file)
index 0000000..df20d6b
--- /dev/null
@@ -0,0 +1,32 @@
+#include <curl/curl.h>
+
+#include <mutex>
+#include <string>
+
+#include "prometheus/detail/http_method.h"
+
+namespace prometheus {
+namespace detail {
+
+class CurlWrapper {
+ public:
+  CurlWrapper(const std::string& username, const std::string& password);
+
+  CurlWrapper(const CurlWrapper&) = delete;
+  CurlWrapper(CurlWrapper&&) = delete;
+  CurlWrapper& operator=(const CurlWrapper&) = delete;
+  CurlWrapper& operator=(CurlWrapper&&) = delete;
+
+  ~CurlWrapper();
+
+  int performHttpRequest(HttpMethod method, const std::string& uri,
+                         const std::string& body);
+
+ private:
+  CURL* curl_;
+  std::string auth_;
+  std::mutex mutex_;
+};
+
+}  // namespace detail
+}  // namespace prometheus