1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-09-10 05:54:22 -04:00
v2fly/proxy/registry/config_cache_json.go

26 lines
659 B
Go
Raw Normal View History

2016-06-10 16:26:39 -04:00
// +build json
package registry
2016-06-10 16:26:39 -04:00
import (
2016-08-20 14:55:45 -04:00
"v2ray.com/core/common/loader"
2016-06-10 16:26:39 -04:00
)
2016-10-13 05:14:24 -04:00
var (
inboundConfigCache loader.ConfigLoader
outboundConfigCache loader.ConfigLoader
)
func CreateInboundConfig(protocol string, data []byte) (interface{}, error) {
return inboundConfigCache.LoadWithID(data, protocol)
}
func CreateOutboundConfig(protocol string, data []byte) (interface{}, error) {
return outboundConfigCache.LoadWithID(data, protocol)
}
2016-06-10 16:26:39 -04:00
func init() {
2016-09-21 08:39:07 -04:00
inboundConfigCache = loader.NewJSONConfigLoader(inboundConfigCreatorCache, "protocol", "settings")
outboundConfigCache = loader.NewJSONConfigLoader(outboundConfigCreatorCache, "protocol", "settings")
2016-06-10 16:26:39 -04:00
}