21 lines
404 B
C#
21 lines
404 B
C#
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
|
|
);
|
|
}
|
|
} |