1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-04-15 18:19:15 -04:00

generalized event handler

This commit is contained in:
Darien Raymond
2017-11-28 23:41:20 +01:00
parent 973ce07db9
commit fd8db49dc9
16 changed files with 80 additions and 32 deletions

View File

@@ -39,7 +39,7 @@ func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) {
if space == nil {
return nil, newError("Space not found.")
}
space.OnInitialize(func() error {
space.On(app.SpaceInitializing, func(interface{}) error {
pm := policy.FromSpace(space)
if pm == nil {
return newError("Policy not found in space.")

View File

@@ -47,7 +47,7 @@ func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) {
account: account,
}
space.OnInitialize(func() error {
space.On(app.SpaceInitializing, func(interface{}) error {
pm := policy.FromSpace(space)
if pm == nil {
return newError("Policy not found in space.")