aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/http/client/query.cpp
diff options
context:
space:
mode:
authorqrort <qrort@yandex-team.com>2022-12-02 11:31:25 +0300
committerqrort <qrort@yandex-team.com>2022-12-02 11:31:25 +0300
commitb1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806 (patch)
tree2a23209faf0fea5586a6d4b9cee60d1b318d29fe /library/cpp/http/client/query.cpp
parent559174a9144de40d6bb3997ea4073c82289b4974 (diff)
downloadydb-b1f4ffc9c8abff3ba58dc1ec9a9f92d2f0de6806.tar.gz
remove kikimr/driver DEPENDS
Diffstat (limited to 'library/cpp/http/client/query.cpp')
-rw-r--r--library/cpp/http/client/query.cpp92
1 files changed, 0 insertions, 92 deletions
diff --git a/library/cpp/http/client/query.cpp b/library/cpp/http/client/query.cpp
deleted file mode 100644
index 36a946074b1..00000000000
--- a/library/cpp/http/client/query.cpp
+++ /dev/null
@@ -1,92 +0,0 @@
-#include "query.h"
-#include "request.h"
-
-namespace NHttp {
- TFetchQuery::TFetchQuery(const TString& url,
- const TFetchOptions& options)
- : Url_(url)
- , Options_(options)
- {
- }
-
- TFetchQuery::TFetchQuery(const TString& url,
- const TVector<TString>& headers,
- const TFetchOptions& options)
- : Url_(url)
- , Headers_(headers)
- , Options_(options)
- {
- }
-
- TFetchQuery::~TFetchQuery() = default;
-
- TString TFetchQuery::GetUrl() const {
- return Url_;
- }
-
- TFetchQuery& TFetchQuery::OnFail(TOnFail cb) {
- OnFailCb_ = cb;
- return *this;
- }
-
- TFetchQuery& TFetchQuery::OnRedirect(TOnRedirect cb) {
- OnRedirectCb_ = cb;
- return *this;
- }
-
- TFetchQuery& TFetchQuery::OnPartialRead(NHttpFetcher::TNeedDataCallback cb) {
- OnPartialReadCb_ = cb;
- return *this;
- }
-
- TFetchRequestRef TFetchQuery::ConstructRequest() const {
- TFetchRequestRef request = new TFetchRequest(Url_, Headers_, Options_);
- if (OnFailCb_) {
- request->SetOnFail(*OnFailCb_);
- }
-
- if (OnRedirectCb_) {
- request->SetOnRedirect(*OnRedirectCb_);
- }
-
- if (OnPartialReadCb_) {
- request->SetOnPartialRead(*OnPartialReadCb_);
- }
-
- return request;
- }
-
- TFetchState::TFetchState() {
- }
-
- TFetchState::TFetchState(const TFetchRequestRef& req)
- : Request_(req)
- {
- }
-
- void TFetchState::Cancel() const {
- if (Request_) {
- Request_->Cancel();
- }
- }
-
- NHttpFetcher::TResultRef TFetchState::Get() const {
- if (Request_) {
- WaitI();
- return Request_->MakeResult();
- }
- return NHttpFetcher::TResultRef();
- }
-
- void TFetchState::WaitI() const {
- WaitT(TDuration::Max());
- }
-
- bool TFetchState::WaitT(TDuration timeout) const {
- if (Request_) {
- return Request_->WaitT(timeout);
- }
- return false;
- }
-
-}