Class ConsulCfgOptions
Consul 配置选项
public sealed class ConsulCfgOptions
- Inheritance
-
ConsulCfgOptions
- Inherited Members
Properties
Address
Consul 服务地址,默认 http://localhost:8500
public string Address { get; set; }
Property Value
ConnectTimeout
连接超时时间,默认 10 秒
public TimeSpan ConnectTimeout { get; set; }
Property Value
DataFormat
配置数据格式,默认 KeyValue(每个 key 一个值)
public ConsulDataFormat DataFormat { get; set; }
Property Value
Datacenter
数据中心名称(可选)
public string? Datacenter { get; set; }
Property Value
EnableHotReload
是否启用热重载,默认 true
public bool EnableHotReload { get; set; }
Property Value
KeyPrefix
KV 键前缀,默认 "config/"
public string KeyPrefix { get; set; }
Property Value
ReconnectInterval
重连间隔,默认 5 秒
public TimeSpan ReconnectInterval { get; set; }
Property Value
SingleKey
当 DataFormat 为 Json/Yaml 时,指定要读取的单个 key
public string? SingleKey { get; set; }
Property Value
Token
ACL Token(可选)
public string? Token { get; set; }
Property Value
WaitTime
Blocking Query 等待时间,默认 5 分钟
public TimeSpan WaitTime { get; set; }