Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Imp: load the configure file in another way #1099

Merged
merged 4 commits into from
Apr 5, 2021
Merged

Conversation

qq5272689
Copy link
Contributor

解决问题:
1、默认使用init初始化,灵活性欠佳,集成进例如cobra这样的框架不够方便,参数存在冲突。
2、原初始化后如果baseconf没有生成,没有相应的set方法重新设置
3、增加baseconf配置文件,优先使用配置文件加载,如不使用配置文件则按原先得方式加载
//保留原初始化方式,把原来的init()中的处理逻辑集成进Load()函数,使用方式不变。
config.Load()
//config_loader 增加option 功能,实现按需初始化。
`
//保留原初始化方式,把原来的init()中的处理逻辑集成进Load()函数,使用方式不变。
config.Load()
//新的初始化方式(按需初始化)
config.LoadWithOptions(config.BaseInitOption(""),config.ConsumerInitOption(confConFile))
//目前转化成6个初始化选项:
//RouterInitOption、ConsumerInitOption、ProviderInitOption、BaseInitOption、ConsumerMustInitOption、ProviderMustInitOption

@@ -19,6 +19,7 @@ package config

import (
"bytes"
"github.com/apache/dubbo-go/common/yaml"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, guy, move it to the 3rd import block.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's done

@AlexStocks
Copy link
Contributor

cc @georgehao, pls review this pr.

@AlexStocks
Copy link
Contributor

pls merge the latest code from branch 3.0 and fix the conflict. thx.

@AlexStocks AlexStocks changed the title 增加配置初始化的选项功能 Imp: load the configure file in another way Apr 5, 2021
@AlexStocks AlexStocks merged commit abbd985 into apache:3.0 Apr 5, 2021
cityiron pushed a commit that referenced this pull request Apr 11, 2021
Imp: load the configure file in another way
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants