mirror of https://github.com/v2ray/v2ray-core
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
728 B
25 lines
728 B
8 years ago
|
package registry
|
||
9 years ago
|
|
||
|
import "github.com/v2ray/v2ray-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)
|
||
|
}
|