mirror of
https://github.com/v2ray/v2ray-core.git
synced 2026-11-07 08:34:16 +00:00
refactor dependency resolution
This commit is contained in:
36 files changed
+355
-729
No files matched your search
@@ -43,7 +43,7 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
|
||||
v := core.MustFromContext(ctx)
|
||||
return &Client{
|
||||
serverPicker: protocol.NewRoundRobinServerPicker(serverList),
|
||||
policyManager: v.PolicyManager(),
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
|
||||
v := core.MustFromContext(ctx)
|
||||
s := &Server{
|
||||
config: config,
|
||||
policyManager: v.PolicyManager(),
|
||||
policyManager: v.GetFeature(policy.ManagerType()).(policy.Manager),
|
||||
}
|
||||
return s, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user