13 #ifndef __NET_RATELIMIT_H__
14 #define __NET_RATELIMIT_H__
24 class NET_HTTPRequest;
57 bool myShouldLimit =
false;
62 const NET_HTTPRequest& request,
67 bool increment =
false);
70 const NET_HTTPRequest& request,
84 const std::initializer_list<UT_StringHolder>& methods);
86 void handle(NET_HTTPRequest& req)
override;
95 #endif // __NET_RATELIMIT_H__
void settings(const UT_StringHolder &group, NET_HTTPRateKey key, const NET_HTTPRate &rate, const std::initializer_list< UT_StringHolder > &methods)
NET_API NET_HTTPRateLimit NETgetRateUsage(const NET_HTTPRequest &request, const UT_StringRef &group, NET_HTTPRateKey key, const NET_HTTPRate &rate, const UT_StringArray &methods, bool increment)
UT_Function< std::pair< int, int >(const UT_StringRef &, const NET_HTTPRequest &)> func_t
NET_HTTPRate(int count, int seconds)
std::function< T > UT_Function
NET_API bool NETisRateLimited(const NET_HTTPRequest &request, const UT_StringRef &group, NET_HTTPRateKey key, const NET_HTTPRate &rate, const UT_StringArray &methods=UT_StringArray(), bool increment=false)
void handle(NET_HTTPRequest &req) override