feat: 初始化 Gateway 仓库
This commit is contained in:
27
Configuration/GatewayRateLimitOptions.cs
Normal file
27
Configuration/GatewayRateLimitOptions.cs
Normal file
@@ -0,0 +1,27 @@
|
||||
namespace TakeoutSaaS.ApiGateway.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// 网关限流参数配置。
|
||||
/// </summary>
|
||||
public class GatewayRateLimitOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否开启固定窗口限流。
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 固定窗口内允许的最大请求数。
|
||||
/// </summary>
|
||||
public int PermitLimit { get; set; } = 300;
|
||||
|
||||
/// <summary>
|
||||
/// 固定窗口长度(秒)。
|
||||
/// </summary>
|
||||
public int WindowSeconds { get; set; } = 60;
|
||||
|
||||
/// <summary>
|
||||
/// 排队等待的最大请求数。
|
||||
/// </summary>
|
||||
public int QueueLimit { get; set; } = 100;
|
||||
}
|
||||
Reference in New Issue
Block a user