mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-01 19:27:53 +08:00
Add newline at EOF (#1932)
This commit is contained in:
parent
674137e89d
commit
56a53165b6
@ -75,6 +75,7 @@ IndentCaseLabels: true
|
||||
IndentPPDirectives: None
|
||||
IndentWidth: 4
|
||||
IndentWrappedFunctionNames: false
|
||||
InsertNewlineAtEOF: true
|
||||
JavaScriptQuotes: Leave
|
||||
JavaScriptWrapImports: true
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
|
@ -468,4 +468,4 @@ void create_controller::createARestfulController(const std::string &className,
|
||||
<< std::endl;
|
||||
std::cout << "File name: " << ctlName << ".h and " << ctlName << ".cc"
|
||||
<< std::endl;
|
||||
}
|
||||
}
|
||||
|
@ -8,4 +8,4 @@ void JsonCtrl::asyncHandleHttpRequest(
|
||||
ret["message"] = "Hello, World!";
|
||||
auto resp = HttpResponse::newHttpJsonResponse(ret);
|
||||
callback(resp);
|
||||
}
|
||||
}
|
||||
|
@ -43,4 +43,4 @@ int main()
|
||||
.setUploadPath("./uploads")
|
||||
.addListener("127.0.0.1", 8848)
|
||||
.run();
|
||||
}
|
||||
}
|
||||
|
@ -37,4 +37,4 @@ class SayHello : public HttpController<SayHello>
|
||||
"Hi there, this is another hello from the SayHello Controller");
|
||||
callback(resp);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -26,4 +26,4 @@ class HelloViewController : public HttpSimpleController<HelloViewController>
|
||||
auto resp = HttpResponse::newHttpViewResponse("HelloView", data);
|
||||
callback(resp);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
@ -211,4 +211,4 @@ class JsonStore : public HttpController<JsonStore>
|
||||
int main()
|
||||
{
|
||||
app().addListener("127.0.0.1", 8848).run();
|
||||
}
|
||||
}
|
||||
|
@ -65,4 +65,4 @@ int main()
|
||||
.enableSession(24h)
|
||||
.addListener("127.0.0.1", 8848)
|
||||
.run();
|
||||
}
|
||||
}
|
||||
|
@ -11,4 +11,4 @@ template <>
|
||||
inline std::string toString<trantor::Date>(const trantor::Date &date)
|
||||
{
|
||||
return std::to_string(date.microSecondsSinceEpoch());
|
||||
}
|
||||
}
|
||||
|
@ -70,4 +70,4 @@ void TimeFilter::doFilter(const HttpRequestPtr &req,
|
||||
co_return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -97,4 +97,4 @@ void SimpleReverseProxy::preRouting(const HttpRequestPtr &req,
|
||||
callback(errResp);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -70,4 +70,4 @@ void WebSocketChat::handleNewConnection(const HttpRequestPtr &req,
|
||||
int main()
|
||||
{
|
||||
app().addListener("127.0.0.1", 8848).run();
|
||||
}
|
||||
}
|
||||
|
@ -116,4 +116,4 @@ class DROGON_EXPORT Redirector : public drogon::Plugin<Redirector>,
|
||||
};
|
||||
|
||||
} // namespace plugin
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -144,4 +144,4 @@ class OStringStream
|
||||
private:
|
||||
std::string buffer_;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -15,4 +15,4 @@
|
||||
#include <drogon/utils/monitoring/Metric.h>
|
||||
#include <drogon/utils/monitoring/Registry.h>
|
||||
#include <drogon/utils/monitoring/Collector.h>
|
||||
#include <drogon/utils/monitoring/Sample.h>
|
||||
#include <drogon/utils/monitoring/Sample.h>
|
||||
|
@ -129,4 +129,4 @@ class Collector : public CollectorBase
|
||||
mutable std::mutex mutex_;
|
||||
};
|
||||
} // namespace monitoring
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -106,4 +106,4 @@ class Gauge : public Metric
|
||||
trantor::Date timestamp_{0};
|
||||
};
|
||||
} // namespace monitoring
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -74,4 +74,4 @@ class Metric : public std::enable_shared_from_this<Metric>
|
||||
using MetricPtr = std::shared_ptr<Metric>;
|
||||
|
||||
} // namespace monitoring
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -32,4 +32,4 @@ class Registry
|
||||
const std::shared_ptr<CollectorBase> &collector) = 0;
|
||||
};
|
||||
} // namespace monitoring
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -32,4 +32,4 @@ struct Sample
|
||||
std::vector<std::pair<std::string, std::string>> exLabels;
|
||||
};
|
||||
} // namespace monitoring
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -72,4 +72,4 @@ class LifeTimeWatch
|
||||
StopWatch stopWatch_;
|
||||
std::function<void(double)> callback_;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -18,4 +18,4 @@ class ConfigAdapter
|
||||
|
||||
using ConfigAdapterPtr = std::shared_ptr<ConfigAdapter>;
|
||||
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -37,4 +37,4 @@ ConfigAdapterManager::ConfigAdapterManager()
|
||||
{
|
||||
REGISTER_CONFIG_ADAPTER(JsonConfigAdapter);
|
||||
REGISTER_CONFIG_ADAPTER(YamlConfigAdapter);
|
||||
}
|
||||
}
|
||||
|
@ -16,4 +16,4 @@ class ConfigAdapterManager
|
||||
ConfigAdapterManager();
|
||||
std::map<std::string, ConfigAdapterPtr> adapters_;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -55,4 +55,4 @@ bool DbClientManager::areAllDbClientsAvailable() const noexcept
|
||||
|
||||
DbClientManager::~DbClientManager()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -29,4 +29,4 @@ bool FixedWindowRateLimiter::isAllowed()
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -105,4 +105,4 @@ void GlobalFilters::initAndStart(const Json::Value &config)
|
||||
void GlobalFilters::shutdown()
|
||||
{
|
||||
filters_.clear();
|
||||
}
|
||||
}
|
||||
|
@ -77,4 +77,4 @@ std::vector<Sample> Histogram::collect() const
|
||||
countSample.value = totalCount;
|
||||
samples.emplace_back(std::move(countSample));
|
||||
return samples;
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,4 @@ void handleException(const std::exception &e,
|
||||
app().getExceptionHandler()(e, req, std::move(callback));
|
||||
}
|
||||
} // namespace internal
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -730,4 +730,4 @@ void HttpClientImpl::addSSLConfigs(
|
||||
{
|
||||
sslConfCmds_.push_back(cmd);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -44,4 +44,4 @@ std::string HttpViewData::htmlTranslate(const char *str, size_t length)
|
||||
++str;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -12,4 +12,4 @@ class JsonConfigAdapter : public ConfigAdapter
|
||||
noexcept(false) override;
|
||||
std::vector<std::string> getExtensions() const override;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -118,4 +118,4 @@ std::shared_ptr<PluginBase> PluginsManager::getSharedPlugin(
|
||||
return iter->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -51,4 +51,4 @@ void RedisClientManager::createRedisClient(const std::string & /*name*/,
|
||||
|
||||
RedisClientManager::~RedisClientManager()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
@ -69,4 +69,4 @@ bool RedisResult::isNil() const noexcept
|
||||
abort();
|
||||
}
|
||||
} // namespace nosql
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -20,4 +20,4 @@ class SlidingWindowRateLimiter : public RateLimiter
|
||||
std::chrono::steady_clock::time_point lastTime_;
|
||||
std::chrono::duration<double> timeUnit_;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -38,4 +38,4 @@ void TaskTimeoutFlag::runTimer()
|
||||
bool TaskTimeoutFlag::done()
|
||||
{
|
||||
return isDone_.exchange(true);
|
||||
}
|
||||
}
|
||||
|
@ -36,4 +36,4 @@ class TaskTimeoutFlag : public trantor::NonCopyable,
|
||||
std::chrono::duration<double> timeout_;
|
||||
std::function<void()> timeoutFunc_;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -12,4 +12,4 @@ class YamlConfigAdapter : public ConfigAdapter
|
||||
noexcept(false) override;
|
||||
std::vector<std::string> getExtensions() const override;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -214,4 +214,4 @@ void DigestAuthFilter::doFilter(const HttpRequestPtr &req,
|
||||
"\", opaque=\"" + opaque + "\"");
|
||||
cb(resp);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -30,4 +30,4 @@ class DigestAuthFilter : public drogon::HttpFilter<DigestAuthFilter, false>
|
||||
virtual void doFilter(const HttpRequestPtr &req,
|
||||
FilterCallback &&cb,
|
||||
FilterChainCallback &&ccb) override;
|
||||
};
|
||||
};
|
||||
|
@ -11,4 +11,4 @@ void ForwardCtrl::asyncHandleHttpRequest(
|
||||
callback(resp);
|
||||
},
|
||||
"https://api.github.com");
|
||||
}
|
||||
}
|
||||
|
@ -53,4 +53,4 @@ void MethodTest::postRegex(
|
||||
{
|
||||
LOG_DEBUG << regStr;
|
||||
makePostRespose(callback);
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,4 @@ void TimeFilter::doFilter(const HttpRequestPtr &req,
|
||||
LOG_TRACE << "first visit,insert visitDate";
|
||||
req->session()->insert(VDate, now);
|
||||
ccb();
|
||||
}
|
||||
}
|
||||
|
@ -526,4 +526,4 @@ void ApiTest::echoBody(const HttpRequestPtr &req,
|
||||
auto resp = HttpResponse::newHttpResponse();
|
||||
resp->setBody(std::string(req->body()));
|
||||
callback(resp);
|
||||
}
|
||||
}
|
||||
|
@ -26,4 +26,4 @@ DROGON_TEST(ClassName)
|
||||
CHECK(h.className() == "api::v1::hh");
|
||||
CHECK(api::v1::hh::classTypeName() == "api::v1::hh");
|
||||
CHECK(h.name() == "api::v1::hh");
|
||||
}
|
||||
}
|
||||
|
@ -45,4 +45,4 @@ DROGON_TEST(ControllerCreation)
|
||||
REQUIRE(Ctrl::created == false);
|
||||
REQUIRE(SimpleCtrl::created == false);
|
||||
REQUIRE(WsCtrl::created == false);
|
||||
}
|
||||
}
|
||||
|
@ -40,4 +40,4 @@ DROGON_TEST(DrObjectNamespaceTest)
|
||||
auto objPtr2 = DrClassMap::getSingleInstance<::test::TestB>();
|
||||
CHECK(objPtr2.get() != nullptr);
|
||||
CHECK(objPtr == objPtr2);
|
||||
}
|
||||
}
|
||||
|
@ -39,4 +39,4 @@ DROGON_TEST(FileTypeTest)
|
||||
CHECK(parseFileType("") == FT_UNKNOWN);
|
||||
CHECK(parseFileType("don'tknow") == FT_CUSTOM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -316,4 +316,4 @@ DROGON_TEST(Gzip)
|
||||
|
||||
auto decompressStr = utils::gzipDecompress(ret.data(), ret.length());
|
||||
CHECK(inStr == decompressStr);
|
||||
}
|
||||
}
|
||||
|
@ -56,4 +56,4 @@ DROGON_TEST(OStringStreamTest)
|
||||
|
||||
CHECK(ss.str() == "hello world!1233.14");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -9,4 +9,4 @@ DROGON_TEST(SHA1Test)
|
||||
"678901234567890123456789012345678901234567890";
|
||||
auto str = drogon::utils::getSha1(in, strlen((const char *)in));
|
||||
CHECK(str == "FECFD28BBC9345891A66D7C1B8FF46E60192D284");
|
||||
}
|
||||
}
|
||||
|
@ -66,4 +66,4 @@ class RedisException final : public std::exception
|
||||
|
||||
using RedisExceptionCallback = std::function<void(const RedisException &)>;
|
||||
} // namespace nosql
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -68,4 +68,4 @@ class RedisTransactionImpl final
|
||||
double timeout_{-1.0};
|
||||
};
|
||||
} // namespace nosql
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -180,4 +180,4 @@ class DROGON_EXPORT RestfulController : trantor::NonCopyable
|
||||
std::unordered_map<std::string, size_t> masqueradingMap_;
|
||||
const std::vector<std::string> columnsVector_;
|
||||
};
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
@ -80,4 +80,4 @@ orm::Criteria RestfulController::makeCriteria(
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
@ -125,4 +125,4 @@ int main()
|
||||
};
|
||||
LOG_TRACE << "end";
|
||||
getchar();
|
||||
}
|
||||
}
|
||||
|
@ -50,4 +50,4 @@ class Sqlite3ResultImpl : public ResultImpl
|
||||
size_t insertId_{0};
|
||||
};
|
||||
} // namespace orm
|
||||
} // namespace drogon
|
||||
} // namespace drogon
|
||||
|
Loading…
Reference in New Issue
Block a user