Table of Contents

Class CfgBuilderExtensions

Namespace
Apq.Cfg.Zookeeper
Assembly
Apq.Cfg.Zookeeper.dll

CfgBuilder 的 Zookeeper 扩展方法

public static class CfgBuilderExtensions
Inheritance
CfgBuilderExtensions
Inherited Members

Methods

AddZookeeper(CfgBuilder, Action<ZookeeperCfgOptions>, int, bool)

添加 Zookeeper 配置源

public static CfgBuilder AddZookeeper(this CfgBuilder builder, Action<ZookeeperCfgOptions> configure, int level = 200, bool isPrimaryWriter = false)

Parameters

builder CfgBuilder

配置构建器

configure Action<ZookeeperCfgOptions>

配置选项

level int

配置层级,数值越大优先级越高,默认为 Zookeeper (15)

isPrimaryWriter bool

是否为主写入源,默认为false

Returns

CfgBuilder

配置构建器实例,支持链式调用

AddZookeeper(CfgBuilder, string, string, int, bool)

添加 Zookeeper 配置源(使用默认选项)

public static CfgBuilder AddZookeeper(this CfgBuilder builder, string connectionString, string rootPath = "/config", int level = 200, bool enableHotReload = true)

Parameters

builder CfgBuilder

配置构建器

connectionString string

Zookeeper 连接字符串,如 localhost:2181

rootPath string

根路径,默认为 "/config"

level int

配置层级,数值越大优先级越高,默认为 Zookeeper (15)

enableHotReload bool

是否启用热重载,默认为true

Returns

CfgBuilder

配置构建器实例,支持链式调用

AddZookeeperJson(CfgBuilder, string, string, int, bool)

添加 Zookeeper 配置源(JSON 格式)

public static CfgBuilder AddZookeeperJson(this CfgBuilder builder, string connectionString, string nodePath, int level = 200, bool enableHotReload = true)

Parameters

builder CfgBuilder

配置构建器

connectionString string

Zookeeper 连接字符串

nodePath string

存储 JSON 配置的节点路径

level int

配置层级,数值越大优先级越高,默认为 Zookeeper (15)

enableHotReload bool

是否启用热重载,默认为true

Returns

CfgBuilder

配置构建器实例,支持链式调用