1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-08-11 06:54:34 -04:00
v2fly/proxy/registry/config_cache.go
2016-08-20 20:55:45 +02:00

25 lines
715 B
Go

package registry
import "v2ray.com/core/common/loader"
var (
inboundConfigCache loader.ConfigLoader
outboundConfigCache loader.ConfigLoader
)
func RegisterInboundConfig(protocol string, creator loader.ConfigCreator) error {
return inboundConfigCache.RegisterCreator(protocol, creator)
}
func RegisterOutboundConfig(protocol string, creator loader.ConfigCreator) error {
return outboundConfigCache.RegisterCreator(protocol, creator)
}
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)
}