Class CfgBuilderExtensions
CfgBuilder 的 Apollo 扩展方法
public static class CfgBuilderExtensions
- Inheritance
-
CfgBuilderExtensions
- Inherited Members
Methods
AddApollo(CfgBuilder, Action<ApolloCfgOptions>, int, bool)
添加 Apollo 配置源
public static CfgBuilder AddApollo(this CfgBuilder builder, Action<ApolloCfgOptions> configure, int level = 200, bool isPrimaryWriter = false)
Parameters
builderCfgBuilder配置构建器
configureAction<ApolloCfgOptions>配置选项
levelint配置层级,数值越大优先级越高,默认为 Apollo (15)
isPrimaryWriterbool是否为主写入源(Apollo 不支持写入),默认为false
Returns
- CfgBuilder
配置构建器实例,支持链式调用
AddApollo(CfgBuilder, string, string, string[]?, int, bool)
添加 Apollo 配置源(使用默认选项)
public static CfgBuilder AddApollo(this CfgBuilder builder, string appId, string metaServer = "http://localhost:8080", string[]? namespaces = null, int level = 200, bool enableHotReload = true)
Parameters
builderCfgBuilder配置构建器
appIdstringApollo 应用 ID
metaServerstringMeta Server 地址,默认为 "http://localhost:8080"
namespacesstring[]命名空间列表,默认为 ["application"]
levelint配置层级,数值越大优先级越高,默认为 Apollo (15)
enableHotReloadbool是否启用热重载,默认为true
Returns
- CfgBuilder
配置构建器实例,支持链式调用