Table of Contents

Class ConsulCfgOptions

Namespace
Apq.Cfg.Consul
Assembly
Apq.Cfg.Consul.dll

Consul 配置选项

public sealed class ConsulCfgOptions
Inheritance
ConsulCfgOptions
Inherited Members

Properties

Address

Consul 服务地址,默认 http://localhost:8500

public string Address { get; set; }

Property Value

string

ConnectTimeout

连接超时时间,默认 10 秒

public TimeSpan ConnectTimeout { get; set; }

Property Value

TimeSpan

DataFormat

配置数据格式,默认 KeyValue(每个 key 一个值)

public ConsulDataFormat DataFormat { get; set; }

Property Value

ConsulDataFormat

Datacenter

数据中心名称(可选)

public string? Datacenter { get; set; }

Property Value

string

EnableHotReload

是否启用热重载,默认 true

public bool EnableHotReload { get; set; }

Property Value

bool

KeyPrefix

KV 键前缀,默认 "config/"

public string KeyPrefix { get; set; }

Property Value

string

ReconnectInterval

重连间隔,默认 5 秒

public TimeSpan ReconnectInterval { get; set; }

Property Value

TimeSpan

SingleKey

当 DataFormat 为 Json/Yaml 时,指定要读取的单个 key

public string? SingleKey { get; set; }

Property Value

string

Token

ACL Token(可选)

public string? Token { get; set; }

Property Value

string

WaitTime

Blocking Query 等待时间,默认 5 分钟

public TimeSpan WaitTime { get; set; }

Property Value

TimeSpan