namespace Apq.Cfg.Apollo;
///
/// Apollo 配置选项
///
public sealed class ApolloCfgOptions
{
///
/// Apollo 应用 ID
///
public string AppId { get; set; } = "";
///
/// Apollo Meta Server 地址,默认 "http://localhost:8080"
///
public string MetaServer { get; set; } = "http://localhost:8080";
///
/// 集群名称,默认 "default"
///
public string Cluster { get; set; } = "default";
///
/// 命名空间列表,默认 ["application"]
///
public string[] Namespaces { get; set; } = ["application"];
///
/// 访问密钥(可选,用于访问控制)
///
public string? Secret { get; set; }
///
/// 是否启用热重载,默认 true
///
public bool EnableHotReload { get; set; } = true;
///
/// 连接超时时间,默认 10 秒
///
public TimeSpan ConnectTimeout { get; set; } = TimeSpan.FromSeconds(10);
///
/// 长轮询超时时间,默认 90 秒
///
public TimeSpan LongPollingTimeout { get; set; } = TimeSpan.FromSeconds(90);
///
/// 配置数据格式,默认 Properties
///
public ApolloDataFormat DataFormat { get; set; } = ApolloDataFormat.Properties;
}
///
/// Apollo 数据格式
///
public enum ApolloDataFormat
{
///
/// Properties 格式(key=value)
///
Properties,
///
/// JSON 格式
///
Json,
///
/// YAML 格式
///
Yaml
}