mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-12-26 12:05:35 -05:00
refactor config cache
This commit is contained in:
@@ -21,7 +21,7 @@ func (this *Config) UnmarshalJSON(data []byte) error {
|
||||
|
||||
this.Response = new(NoneResponse)
|
||||
if jsonConfig.Response != nil {
|
||||
loader := loader.NewJSONConfigLoader("type", "")
|
||||
loader := loader.NewJSONConfigLoader(loader.ConfigCreatorCache{}, "type", "")
|
||||
loader.RegisterCreator("none", func() interface{} { return new(NoneResponse) })
|
||||
loader.RegisterCreator("http", func() interface{} { return new(HTTPResponse) })
|
||||
response, _, err := loader.Load(jsonConfig.Response)
|
||||
|
||||
@@ -7,6 +7,6 @@ import (
|
||||
)
|
||||
|
||||
func init() {
|
||||
inboundConfigCache = loader.NewJSONConfigLoader("protocol", "settings")
|
||||
outboundConfigCache = loader.NewJSONConfigLoader("protocol", "settings")
|
||||
inboundConfigCache = loader.NewJSONConfigLoader(loader.ConfigCreatorCache{}, "protocol", "settings")
|
||||
outboundConfigCache = loader.NewJSONConfigLoader(loader.ConfigCreatorCache{}, "protocol", "settings")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user