1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2025-12-29 21:45:21 -05:00

simplify dependency resolution

This commit is contained in:
Darien Raymond
2018-10-22 11:26:22 +02:00
parent 9decb3fe36
commit 307aac26b3
13 changed files with 135 additions and 56 deletions

View File

@@ -7,7 +7,6 @@ import (
"v2ray.com/core"
"v2ray.com/core/common"
"v2ray.com/core/features"
"v2ray.com/core/features/inbound"
"v2ray.com/core/features/outbound"
"v2ray.com/core/proxy"
@@ -132,9 +131,9 @@ func (s *service) Register(server *grpc.Server) {
hs := &handlerServer{
s: s.v,
}
s.v.RequireFeatures([]interface{}{inbound.ManagerType(), outbound.ManagerType()}, func(fs []features.Feature) {
hs.ihm = fs[0].(inbound.Manager)
hs.ohm = fs[1].(outbound.Manager)
s.v.RequireFeatures(func(im inbound.Manager, om outbound.Manager) {
hs.ihm = im
hs.ohm = om
})
RegisterHandlerServiceServer(server, hs)
}