[test]
This commit is contained in:
parent
c7b257b188
commit
bf6bfdd930
1 changed files with 14 additions and 8 deletions
|
@ -26,6 +26,7 @@ var (
|
|||
rules []C.Rule
|
||||
proxies = make(map[string]C.Proxy)
|
||||
providers map[string]provider.ProxyProvider
|
||||
ruleProviders map[string]provider.RuleProvider
|
||||
configMux sync.RWMutex
|
||||
|
||||
// Outbound Rule
|
||||
|
@ -57,9 +58,10 @@ func Rules() []C.Rule {
|
|||
}
|
||||
|
||||
// UpdateRules handle update rules
|
||||
func UpdateRules(newRules []C.Rule) {
|
||||
func UpdateRules(newRules []C.Rule, rp map[string]provider.RuleProvider) {
|
||||
configMux.Lock()
|
||||
rules = newRules
|
||||
ruleProviders = rp
|
||||
configMux.Unlock()
|
||||
}
|
||||
|
||||
|
@ -73,6 +75,10 @@ func Providers() map[string]provider.ProxyProvider {
|
|||
return providers
|
||||
}
|
||||
|
||||
func RuleProviders() map[string]provider.RuleProvider {
|
||||
return ruleProviders
|
||||
}
|
||||
|
||||
// UpdateProxies handle update proxies
|
||||
func UpdateProxies(newProxies map[string]C.Proxy, newProviders map[string]provider.ProxyProvider) {
|
||||
configMux.Lock()
|
||||
|
|
Loading…
Reference in a new issue