feat: 初始化 Gateway 仓库
This commit is contained in:
22
Configuration/GatewayOpenTelemetryOptions.cs
Normal file
22
Configuration/GatewayOpenTelemetryOptions.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace TakeoutSaaS.ApiGateway.Configuration;
|
||||
|
||||
/// <summary>
|
||||
/// 网关 OpenTelemetry 导出配置。
|
||||
/// </summary>
|
||||
public class GatewayOpenTelemetryOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// 是否启用 OpenTelemetry。
|
||||
/// </summary>
|
||||
public bool Enabled { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// 服务名称,用于 Resource 标识。
|
||||
/// </summary>
|
||||
public string ServiceName { get; set; } = "TakeoutSaaS.ApiGateway";
|
||||
|
||||
/// <summary>
|
||||
/// OTLP 导出端点(http/https)。
|
||||
/// </summary>
|
||||
public string? OtlpEndpoint { get; set; }
|
||||
}
|
||||
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