mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-19 15:02:10 +00:00
unified config loader
This commit is contained in:
1 parent
3f7b70a465
commit
e732ba62a6
18 files changed
+257
-215
No files matched your search
@@ -0,0 +1,24 @@
|
||||
package internal
|
||||
|
||||
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)
|
||||
}
|
||||
Reference in new issue
Block a user