Adding RateLimit Feature ...
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
using xCommons.Models;
|
||||
using xCommons.Configurations;
|
||||
|
||||
namespace xCommons.Interfaces
|
||||
{
|
||||
public interface IXRateLimitProvider
|
||||
{
|
||||
bool IsEnabled { get; }
|
||||
|
||||
XRateLimitResult TryConsume(
|
||||
string key,
|
||||
int limit,
|
||||
int periodSeconds
|
||||
);
|
||||
|
||||
XRateLimitResult TryConsume(
|
||||
string key,
|
||||
XRateLimitRule rule
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user