Feat: add switch config file API

This commit is contained in:
Dreamacro
2018-11-30 17:42:40 +08:00
parent dc24dd4d89
commit 9cfd26d440
4 changed files with 38 additions and 4 deletions

View File

@ -19,10 +19,12 @@ func ParseWithPath(path string) (*config.Config, error) {
}
// ApplyConfig dispatch configure to all parts
func ApplyConfig(cfg *config.Config) {
func ApplyConfig(cfg *config.Config, force bool) {
if force {
updateGeneral(cfg.General)
}
updateProxies(cfg.Proxies)
updateRules(cfg.Rules)
updateGeneral(cfg.General)
}
func GetGeneral() *config.General {