Table of Contents

Class CfgBuilderExtensions

Namespace
Apq.Cfg.Apollo
Assembly
Apq.Cfg.Apollo.dll

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

builder CfgBuilder

配置构建器

configure Action<ApolloCfgOptions>

配置选项

level int

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

isPrimaryWriter bool

是否为主写入源(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

builder CfgBuilder

配置构建器

appId string

Apollo 应用 ID

metaServer string

Meta Server 地址,默认为 "http://localhost:8080"

namespaces string[]

命名空间列表,默认为 ["application"]

level int

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

enableHotReload bool

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

Returns

CfgBuilder

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