-
Notifications
You must be signed in to change notification settings - Fork 929
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
Conversation
config/base_config.go
Outdated
@@ -19,6 +19,7 @@ package config | |||
|
|||
import ( | |||
"bytes" | |||
"github.com/apache/dubbo-go/common/yaml" |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's done
cc @georgehao, pls review this pr. |
pls merge the latest code from branch 3.0 and fix the conflict. thx. |
Imp: load the configure file in another way
解决问题:
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